| This issue seems to be specifically about the Declarative syntax, rather than how the plugin’s underlying steps work (and thus what the Scripted syntax would look like). The kubernetes block is required inside agent to activate this plugin. Different agent launching technologies work fundamentally differently and there is no use obscuring which has been selected. Given JENKINS-57830 (the use of Jenkins labels is an implementation detail that most Jenkinsfile authors should not need to pay attention to) and some related changes, we could probably boil down the syntax to something like
agent {
kubernetes {
containerTemplate {
image 'maven:3.6.1-jdk-11'
defaultContainer: true
}
}
}
without loss of backward compatibility and with minimal redundancy in syntactic options. |