Pod retention policy onFailure is not applied

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

XMLWordPrintable

      When the Pod retention policy is set on "onFailure" and the build fails, the slaves should be kept for debug and analysis. However, they are terminated immediately as if the build was succesful.

       

      For instance, we can use this simple Pod template.

      podTemplate(podRetention: onFailure(),
      activeDeadlineSeconds: 600,
      yaml: """
      apiVersion: v1
      kind: Pod
      spec:
       containers:
       - name: ansible
       image: (private repo)/ansible:0.2
       imagePullPolicy: IfNotPresent
       command: ['cat']
       tty: true
      """
      )

       

      I have also used a simple pipeline

      {
          node(POD_LABEL) {
            container('ansible') {
              sh "sleep 10"
              sh "hola"
            }
          }
      }
      

      As a result the pod will fail, since the if not such command as "hola".

      Due to the Pod retention policy, I would expect that the pod is still alive for the timeout configured, but Jenkins terminates it.

      To reproduce this issue is as simple as deploy the stable/jenkins Helm chart and create a pipeline with the details given above.

            Assignee:
            Unassigned
            Reporter:
            Ignacio Pascual
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: