Using label feild while declaring Kubernetes agent gives a warning

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

XMLWordPrintable

      Using label field while declaring Kubernetes agent gives a  deprecation warning even when using yaml format

      [WARNING] label option is deprecated. To use a static pod template, use the 'inheritFrom' option.

      Is this deprecation intended as specifying label is helpul especially in monitoring.

      The declarative pipeline used is

      pipeline {
          agent {
              kubernetes {
                  label 'sample-label'
                  yaml '''
      apiVersion: v1
      kind: Pod
      spec:
        containers:
        - name: shell
          image: ubuntu
          command:
          - sleep
          args:
          - infinity
      '''
              }
          }
          stages {
              stage('Main') {
                  steps {
                      sh 'hostname'
                  }
              }
          }
      }
      

            Assignee:
            Carlos Sanchez
            Reporter:
            Touseef
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: