[WARNING] label option is deprecated. To use a static pod template, use the 'inheritFrom' option.
Is there a workaround or different way to specify the agent labels
Below is the pipeline script
```
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'
}
} }
}