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

    Details

    • Similar Issues:
    • Released As:
      1.29.3

      Description

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

        Attachments

          Issue Links

            Activity

            vlatombe Vincent Latombe created issue -
            vlatombe Vincent Latombe made changes -
            Field Original Value New Value
            Description h3. Reproduction Steps
             # Define the Pod Template in the Kubernetes cloud named standard

             # Create Pipeline with the below script

             # Run the pipeline

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

             
            {code:java}
            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'
                        }
                    }
                }
            }
            {code}
            h3. Reproduction Steps
             # Define the Pod Template in the Kubernetes cloud named "standard"

             # Create Pipeline with the below script

             # Run the pipeline

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

             
            {code:java}
            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'
                        }
                    }
                }
            }
            {code}
            vlatombe Vincent Latombe made changes -
            Assignee Vincent Latombe [ vlatombe ]
            vlatombe Vincent Latombe made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            vlatombe Vincent Latombe made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            vlatombe Vincent Latombe made changes -
            Remote Link This issue links to "PR #982 (Web Link)" [ 26701 ]
            duemir Denys Digtiar made changes -
            Released As 1.29.3
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]

              People

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

                Dates

                Created:
                Updated:
                Resolved: