Skip to content

Commit

Permalink
Merge pull request #134 from austinmoore-/pod-names
Browse files Browse the repository at this point in the history
Make the name field in the pod template the pod name
  • Loading branch information
iocanel authored Feb 15, 2017
2 parents 0887506 + 928c5ef commit b55c773
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class PodTemplateStep extends Step implements Serializable {
@DataBoundConstructor
public PodTemplateStep(String label, String name) {
this.label = label;
this.name = name;
this.name = name == null ? "kubernetes" : name;
}

public String getLabel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class PodTemplateStepExecution extends AbstractStepExecutionImpl {

private static final long serialVersionUID = -6139090518333729333L;

private static final transient String NAME_FORMAT = "kubernetes-%s";
private static final transient String NAME_FORMAT = "%s-%s";

private final PodTemplateStep step;

Expand All @@ -44,7 +44,8 @@ public boolean start() throws Exception {
cloud.getClass().getName()));
}
KubernetesCloud kubernetesCloud = (KubernetesCloud) cloud;
String name = String.format(NAME_FORMAT, UUID.randomUUID().toString().replaceAll("-", ""));
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
String name = String.format(NAME_FORMAT, step.getName(), uuid);

PodTemplateAction action = new PodTemplateAction(getContext().get(Run.class));

Expand Down

0 comments on commit b55c773

Please sign in to comment.