-
Bug
-
Resolution: Duplicate
-
Minor
-
None
See the following:
podTemplate(label: 'x', inheritFrom: 'JenkinsDeployer', nodeUsageMode: 'EXCLUSIVE') { node('x') { echo env.environment podTemplate(label: 'y', inheritFrom: 'JenkinsLiveDeployer', nodeUsageMode: 'EXCLUSIVE') { node('y') { echo env.environment } } } }
Assuming there are pod templates for a 'JenkinsDeployer' which have a set of environment variables and then a pod template for 'JenkinsLiveDeployer', which has a different set of environment variables, then I would expect to see a different value for each echo statement.
Right now, assuming environment on each pod template are respectively pre-production and and production, the actual result of the code snippet above is:
// node starting 'pre-production' // node starting 'pre-production'
whereas the expected value should be:
// node starting 'pre-production' // node starting 'production'
This should be the same behaviour as doing the following but it is *not*:
node('label') { echo env.environment node('live-label') { echo env.environment } }
- duplicates
-
JENKINS-58374 Environment variables not merged properly when inheriting yaml
- Resolved