[JIRA] (JENKINS-58682) Global YAML Merge Strategy is not respected

8 views
Skip to first unread message

dylanhellems@gmail.com (JIRA)

unread,
Jul 26, 2019, 11:25:02 AM7/26/19
to jenkinsc...@googlegroups.com
Dylan Hellems created an issue
 
Jenkins / Bug JENKINS-58682
Global YAML Merge Strategy is not respected
Issue Type: Bug Bug
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2019-07-26 15:24
Environment: Jenkins 2.176.1 LTS running on Kubernetes managed by Amazon EKS kubernetes-plugin 1.17.1
Priority: Major Major
Reporter: Dylan Hellems

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

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

vincent@latombe.net (JIRA)

unread,
Jul 29, 2019, 8:19:02 AM7/29/19
to jenkinsc...@googlegroups.com
Vincent Latombe assigned an issue to Unassigned
Change By: Vincent Latombe
Assignee: Carlos Sanchez

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 19, 2019, 2:42:03 AM9/19/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ updated an issue
Change By: Allan BURDAJEWICZ
Attachment: declarativeExample.groovy
Attachment: scriptedExample.groovy
Attachment: declarativeExample.log
Attachment: scriptedExample.log
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 19, 2019, 2:42:04 AM9/19/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ commented on Bug JENKINS-58682
 
Re: Global YAML Merge Strategy is not respected

I believe that this is mainly a problem for declarative pipeline. That has a different behavior than scripted pipeline according to:

I have attached examples of this difference of behavior. You can see that with scripted, the inherited template image jenkins/jnlp-slave:3.27-1-alpine correctly override the parent template image jenkins/slave:alpine. In declarative, it does not override it.

Note: The merge strategy of the parent template is "Override". declarativeExample.groovy scriptedExample.groovy declarativeExample.log scriptedExample.log

vincent@latombe.net (JIRA)

unread,
Nov 18, 2019, 8:32:05 AM11/18/19
to jenkinsc...@googlegroups.com

vincent@latombe.net (JIRA)

unread,
Nov 18, 2019, 8:48:03 AM11/18/19
to jenkinsc...@googlegroups.com

however, changing the YAML merge strategy configuration at the cloud level seems to have no effect.

Indeed, there is NO global flag to control YAML merge strategy. A pod template controls how it merged with its parent.

What is missing here is support of this field for declarative.

vincent@latombe.net (JIRA)

unread,
Nov 18, 2019, 8:49:03 AM11/18/19
to jenkinsc...@googlegroups.com

vincent@latombe.net (JIRA)

unread,
Nov 18, 2019, 8:50:03 AM11/18/19
to jenkinsc...@googlegroups.com
Vincent Latombe closed an issue as Fixed
 
Change By: Vincent Latombe
Status: Open Closed
Resolution: Fixed
Released As: 1.21.2
Reply all
Reply to author
Forward
0 new messages