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

Global YAML Merge Strategy is not respected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • kubernetes-plugin
    • None
    • Jenkins 2.176.1 LTS running on Kubernetes managed by Amazon EKS kubernetes-plugin 1.17.1
    • 1.21.2

      Summary

      Our team recently attempted an upgrade from kubernetes-plugin version 1.16.1 to 1.17.1, and the update broke our pipelines. We are making use of pod templates at the cloud level for shared configuration of agents, and we are inheriting these templates and extending them in our pipelines. Before the update, our pod template YAML and our pipeline YAML were merged to generate the agent configuration. After the update, the pipeline YAML overrode our pod template completely.  I believe I've traced the issue back to this ticket: https://issues.jenkins-ci.org/browse/JENKINS-58405

      The default YAML merge strategy has been changed to 'override' and an option has been added to change this, however, changing the YAML merge strategy configuration at the cloud level seems to have no effect. This is doubly impactful, as there appears to be no way to configure the YAML merge strategy at the pipeline level with the DSL, which is our team's preferred way of defining pipeline. 

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 8: Invalid config option "yamlMergeStrategy" for agent type "kubernetes". Valid config options are [activeDeadlineSeconds, cloud, containerTemplate, containerTemplates, customWorkspace, defaultContainer, idleMinutes, inheritFrom, instanceCap, label, namespace, nodeSelector, serviceAccount, slaveConnectTimeout, workingDir, yaml, yamlFile] @ line 8, column 17.
                         yamlMergeStrategy merge()
                         ^
      
      1 error
      

       

        1. declarativeExample.groovy
          0.7 kB
          Allan BURDAJEWICZ
        2. declarativeExample.log
          3 kB
          Allan BURDAJEWICZ
        3. scriptedExample.groovy
          0.4 kB
          Allan BURDAJEWICZ
        4. scriptedExample.log
          4 kB
          Allan BURDAJEWICZ

            Unassigned Unassigned
            dylanhellems Dylan Hellems
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: