Nested PodTemplate erroneous behaviour

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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
        }
      }

       

            Assignee:
            Unassigned
            Reporter:
            Christopher Webb
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: