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

Multiple inheritFrom templates ignored in declarative pipeline

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • kubernetes-plugin
    • None
    • Jenkins ver. 2.197
      Plugin version: 1.20.0

      This was working with 1.16.1 version of a plugin. Possible regression?

       

      Here is agent configuration that used to work:

       

      agent {
       kubernetes {
         label "${pipelineParams.argoApplicationPrefix}-preflight"
         defaultContainer 'jnlp'
         idleMinutes 1
         inheritFrom "maven mysql-57 kaniko"
       }

      After upgrading to to 1.20.0 resulting pod template only what was in last entry in that list.

       

      Documentation is lacking on how one can change `yamlMergeStrategy` in declarative pipeline, but I tried creating the same pod temple in Global Configuration with `merge` as strategy - no luck.

       

          [JENKINS-59832] Multiple inheritFrom templates ignored in declarative pipeline

          Thomas Ramé added a comment -

          andoriyu did you fix this issue? I'm facing the exact same problem, I try to inherit from multiple pod templates with "merge" strategy but I just end up with 1/5 of what I should get.

          Any one from the core team aware about that? vlatombe 

          Thomas Ramé added a comment - andoriyu did you fix this issue? I'm facing the exact same problem, I try to inherit from multiple pod templates with "merge" strategy but I just end up with 1/5 of what I should get. Any one from the core team aware about that? vlatombe  

          sneko I ended up making a single large pod template and inherit that one instead of having neat composable templates.

          Andrey Cherkashin added a comment - sneko I ended up making a single large pod template and inherit that one instead of having neat composable templates.

          J added a comment -

          I too have seen this, as recently as the date of this comment. 

          Turned on additional K8S logging, and found it's just combining the pods, not merging them. We should end up with a single pod with all containers, but we end up with separate pods, and it's just keeping the last one defined.

          J added a comment - I too have seen this, as recently as the date of this comment.  Turned on additional K8S logging, and found it's just combining the pods, not merging them. We should end up with a single pod with all containers, but we end up with separate pods, and it's just keeping the last one defined.

            Unassigned Unassigned
            andoriyu Andrey Cherkashin
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: