Skip to content

Commit 3f3178e

Browse files
committed
No point checking for null, the constructor handles the null the same as the default constructor which just passes null directly into this constructor anyway. So if there's a value we get what we want, and if there's not, we still get what we want. Simpler is better.
1 parent b8ba0e0 commit 3f3178e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateStepExecution.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,7 @@ public boolean start() throws Exception {
8484
String name = String.format(NAME_FORMAT, stepName, randString);
8585
String namespace = checkNamespace(cloud, podTemplateContext);
8686

87-
if (step.getId() != null) {
88-
newTemplate = new PodTemplate(step.getId());
89-
} else {
90-
newTemplate = new PodTemplate();
91-
}
92-
87+
newTemplate = new PodTemplate(step.getId());
9388
newTemplate.setName(name);
9489
newTemplate.setNamespace(namespace);
9590

0 commit comments

Comments
 (0)