Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60537

Exception when using multiple labels on a pod template

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • kubernetes-plugin
    • None
    • 1.22.6, 1.23.1

      Affects 1.22.1

      When using a pod template that has multiple labels defined, you get the following exception.

      https://github.com/jenkinsci/kubernetes-plugin/pull/640#commitcomment-36483725

      java.lang.IllegalArgumentException: duplicate key: jenkins/label
      	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115)
      	at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:72)
      	at com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:245)
      	at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:231)
      	at org.csanchez.jenkins.plugins.kubernetes.PodTemplate.getLabelsMap(PodTemplate.java:387)
      	at org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud.addProvisionedSlave(KubernetesCloud.java:599)
      	at org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud.provision(KubernetesCloud.java:542)
      	at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:729)
      	at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:334)
      	at hudson.slaves.NodeProvisioner.access$900(NodeProvisioner.java:64)
      	at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:823)
      	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:70)
      	at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

            vlatombe Vincent Latombe
            vlatombe Vincent Latombe
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: