Pod creation fails when merging the configuration

Article ID:360030824732
1 minute readKnowledge base

Issue

  • After upgrading to version 2.176.1.4 the creation of pods fails.

  • Issue can have two aspects:

    1. An issue when merging two pod templates yaml fields. If a parent pod template has an incorrect yaml field, you would see an error. This is because the yaml fields of the parent pods were ignored before and they are now merged in the definition.

    2. An issue when merging two pod templates environment variables:

      java.lang.IllegalStateException: Duplicate key EnvVar(name=JAVA_TOOL_OPTIONS, value=-Xmx1g, valueFrom=null, additionalProperties={})
          at java.util.stream.Collectors.lambda$throwingMerger$0(Collectors.java:133)
          at java.util.HashMap.merge(HashMap.java:1254)
          at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320)
          at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
          at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
          at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
          at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
          at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
          at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
          at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
          at org.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilder.build(PodTemplateBuilder.java:225)

Environment

Resolution

Both issues are due to changes introduced in the Kubernetes Plugin version 1.15.1.

Issue number one is tracked by JENKINS-58374. It has been fixed in the Kubernetes Plugin version 1.15.8. You can pick it by upgrading to Jenkins 2.176.1.4 revision 2.

Issue number two is tracked by JENKINS-58405. It has been fixed in the Kubernetes Plugin version 1.15.9. You can pick it by upgrading to 2.176.1.4 revision 3.