-
Type:
Story
-
Resolution: Not A Defect
-
Priority:
Minor
-
Component/s: kubernetes-plugin
-
Environment:Jenkins version : v2.249.2
Kubernetes plugin version : 1.27.7
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'
}
}
}
}