inheritFrom cannot overwrite inherited images

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

XMLWordPrintable

      pipeline script

       

      pipeline {
        agent {
          kubernetes {
            inheritFrom 'maven'
            yaml '''
            spec:
              containers:
              - name: maven
                image: my-mavenimage
                volumeMounts:
                - mountPath: "/root/.m2"
                  subPath: mvn_cache
                  name: "volume-cache"
                  readOnly: false
                - mountPath: "/root/.sonar/cache"
                  subPath: sonar-cache
                  name: "volume-cache"
                  readOnly: false
              - name: jnlp
                volumeMounts:
                - mountPath: "/root/.sonar/cache"
                  subPath: sonar-cache
                  name: "volume-cache"
                  readOnly: false
                - mountPath: "/root/.m2"
                  subPath: mvn_cache
                  name: "volume-cache"
                  readOnly: false
              volumes:
              - persistentVolumeClaim:
                  claimName: rule
                name: "volume-cache"
      '''
            defaultContainer 'maven'
          }
        } 

      parent pod template  casc

       

       

      -containers:
      -command:"cat"
      image:"parent image"
      livenessProbe:
      failureThreshold:0
      initialDelaySeconds:0
      periodSeconds:0
      successThreshold:0
      timeoutSeconds:0
      name:"maven"
      resourceLimitCpu:"4000m"
      resourceLimitMemory:"8192Mi"
      resourceRequestCpu:"100m"
      resourceRequestMemory:"100Mi"
      ttyEnabled:true
      workingDir:"/home/jenkins/agent"

       
      The pod is still started using the parent image, pod log

      spec:
        containers:
        - command:
          - "cat"
          image: "parent image"
          imagePullPolicy: "IfNotPresent"
          name: "maven"
          resources: 

            Assignee:
            Unassigned
            Reporter:
            elrond
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: