Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65415

Kubernetes events logs are not displayed when inheriting from a pod template defined in the kubernetes cloud

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • kubernetes-plugin
    • None
    • 1.29.3

      Reproduction Steps

      1. Define the Pod Template in the Kubernetes cloud named "standard"
      1. Create Pipeline with the below script
      1. Run the pipeline

      Expected: Both stages stream the kubernetes events
      Actual: Only first stage where there is no "inheritFrom" is streaming the kubernetes events

       

      pipeline {
          agent none
          stages {
              stage('Pod 1') {
                  agent {
                      kubernetes {
                          yaml '''\
      apiVersion: v1
      kind: Pod
      spec:
        containers:
        - name: shell
          image: ubuntu
          command:
          - sleep
          args:
          - infinity
      '''
                          defaultContainer 'shell'
                      }
                  }
                  steps \{
                      sh 'uname -a && hostname'
                  }
              }
              stage('Pod 2') \{
                  agent {
                      kubernetes {
                          yaml '''\
      apiVersion: v1
      kind: Pod
      spec:
        containers:
        - name: shell
          image: ubuntu
          command:
          - sleep
          args:
          - infinity
      '''
                          inheritFrom 'standard'
                          defaultContainer 'shell'
                      }
                  }
                  steps \{
                      sh 'uname -a && hostname'
                  }
              }
          }
      }
      

            vlatombe Vincent Latombe
            vlatombe Vincent Latombe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: