Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow runAsUser and runAsGroup to be set from the PodTemplateStep #643

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public class PodTemplateStep extends Step implements Serializable {

private Boolean showRawYaml;

private String runAsUser;
private String runAsGroup;

@DataBoundConstructor
public PodTemplateStep() {}

Expand Down Expand Up @@ -273,7 +276,7 @@ public void setImagePullSecrets(List<String> imagePullSecrets) {
}
}


public String getYaml() {
return yaml;
}
Expand Down Expand Up @@ -305,6 +308,24 @@ public void setShowRawYaml(boolean showRawYaml) {
this.showRawYaml = Boolean.valueOf(showRawYaml);
}

public String getRunAsUser(){
return this.runAsUser;
}

@DataBoundSetter
public void setRunAsUser(String runAsUser) {
this.runAsUser = runAsUser;
}

public String getRunAsGroup(){
return this.runAsGroup;
}

@DataBoundSetter
public void setRunAsGroup(String runAsGroup) {
this.runAsGroup = runAsGroup;
}

@Extension
public static class DescriptorImpl extends StepDescriptor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public boolean start() throws Exception {
newTemplate.setNodeSelector(step.getNodeSelector());
newTemplate.setNodeUsageMode(step.getNodeUsageMode());
newTemplate.setServiceAccount(step.getServiceAccount());
newTemplate.setRunAsUser(step.getRunAsUser());
newTemplate.setRunAsGroup(step.getRunAsGroup());
if (step.getHostNetwork() != null) {
newTemplate.setHostNetwork(step.getHostNetwork());
}
Expand Down