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

Updating podTemplate does not immediately come into effect.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When updating a PodTemplate (specifically a containerTemplate) through a jenkinsfile change, the change is not immediately put into effect.

      This seems to be some kind of caching issue, in older versions you could see this through the "Configure System" which would have the old template still populated. Is it especially apparent when someone is on a branch improving the build , but "old" template builds are still happening on master with the same label. In this situation it seems a bit of a race condition as to which version is picked up in the job.

      Workaround;
      We have resorted to changing the template label to force a cache bust. e.i
      label: 'GitPod1' ... label: 'GitPod2' etc. which works reliably.

      P.S Finally getting around to recording some bugs that I have known about for a while, sorry for the spam

        Attachments

          Issue Links

            Activity

            Hide
            inquisitive anshu pitlia added a comment -

            Carlos Sanchez Do you still think I should use UUID or the bug is fixed? Because I faced the same issue last night. It picked up a stale template with the same name. Where does it store/cache the template? What if I completely override the template file, but keep the label same? It doesn't work for me as of now, every time I change a template I have to change the label. 

            Show
            inquisitive anshu pitlia added a comment - Carlos Sanchez Do you still think I should use UUID or the bug is fixed? Because I faced the same issue last night. It picked up a stale template with the same name. Where does it store/cache the template? What if I completely override the template file, but keep the label same? It doesn't work for me as of now, every time I change a template I have to change the label. 
            Hide
            csanchez Carlos Sanchez added a comment -

            This is probably fixed at least partially with https://github.com/jenkinsci/kubernetes-plugin/pull/285

            Show
            csanchez Carlos Sanchez added a comment - This is probably fixed at least partially with https://github.com/jenkinsci/kubernetes-plugin/pull/285
            Hide
            csanchez Carlos Sanchez added a comment -

            ah, kubernetes-podtemplate.xml was just added to persist the pipeline defined templates. It should always match what's in the pipeline

            Show
            csanchez Carlos Sanchez added a comment - ah, kubernetes-podtemplate.xml was just added to persist the pipeline defined templates. It should always match what's in the pipeline
            Hide
            vincentheet Vincent Heet added a comment -

            Thanks for the hint of using a UUID Carlos Sanchez that will definitely fix the issue. I'm a bit confused by you saying you have never seen the kubernetes-podtemplate.xml. It is mentioned in the code here: https://github.com/jenkinsci/kubernetes-plugin/blob/023f8e252fab8896e0ade1fb1b233433f20ce7dc/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateMap.java#L138

            Show
            vincentheet Vincent Heet added a comment - Thanks for the hint of using a UUID Carlos Sanchez  that will definitely fix the issue. I'm a bit confused by you saying you have never seen the kubernetes-podtemplate.xml. It is mentioned in the code here:  https://github.com/jenkinsci/kubernetes-plugin/blob/023f8e252fab8896e0ade1fb1b233433f20ce7dc/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateMap.java#L138
            Show
            csanchez Carlos Sanchez added a comment - See https://github.com/jenkinsci/kubernetes-plugin/pull/281

              People

              Assignee:
              vlatombe Vincent Latombe
              Reporter:
              larslawoko Lars Lawoko
              Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: