Skip to content

Commit

Permalink
Add OWNER_ID and OWNER_EMAIL variables to run container
Browse files Browse the repository at this point in the history
  • Loading branch information
mzueva committed Aug 14, 2023
1 parent ced3998 commit 0808cd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,14 @@ public EnumMap<SystemParams, String> matchCommonParams(PipelineRun run,
.orElse(userManager.loadUserContext(run.getOwner()));
systemParamsWithValue.put(SystemParams.API_TOKEN, authManager
.issueToken(owner, null).getToken());

final PipelineUser user = userManager.loadByNameOrId(run.getOwner());
systemParamsWithValue.put(SystemParams.OWNER, run.getOwner());
systemParamsWithValue.put(SystemParams.OWNER_ID, String.valueOf(user.getId()));
if (StringUtils.hasText(user.getEmail())) {
systemParamsWithValue.put(SystemParams.OWNER_EMAIL, user.getEmail());
}

if (gitCredentials != null) {
putIfStringValuePresent(systemParamsWithValue,
SystemParams.GIT_USER, gitCredentials.getUserName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public enum SystemParams {
MOUNT_OPTIONS("mount-options", "MOUNT_OPTIONS", true),
MOUNT_POINTS("mount-points", "MOUNT_POINTS", true),
OWNER("owner", "OWNER", false),
OWNER_ID("owner-id", "OWNER_ID", false),
OWNER_EMAIL("owner-email", "OWNER_EMAIL", false),
SSH_PASS("ssh-pass", "SSH_PASS", true),
GIT_USER("git-user", "GIT_USER", true),
GIT_TOKEN("git-token", "GIT_TOKEN", true),
Expand Down

0 comments on commit 0808cd8

Please sign in to comment.