declarative pipeline pod inheritance not working as documented

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

XMLWordPrintable

      Currently following documentation found at https://plugins.jenkins.io/kubernetes/#plugin-content-inheritance for leveraging pod template inheritance. 

      Following the example does not produce the expected outcome where the resulting pod container uses an updated image for the specified container.

      JCasC pod base template definition

      templates:
      - name: "jenkins-agent"
        namespace: "jenkins-agents"
        containers:
        - name: jnlp
          image: jnlp:latest
          command: "tail -f /dev/null"
          workingDir: "/home/jenkins/agent"
        - name: maven
          image: maven:latest
          command: "tail -f /dev/null"

      Declarative pipeline definition

      pipeline {
        agent {
          kubernetes {
            cloud 'gke'
            inheritFrom 'jenkins-agent'
            yaml '''
            spec:
              containers:
              - name: maven
                image: maven:3.8.1-jdk-11
      '''
          }
        }
        stages {
          ...
        }
      }

      The resulting agent pod still contains the base maven image rather than the attempted overridden version for the maven container.

            Assignee:
            Unassigned
            Reporter:
            Ryan
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: