-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
it would be nice to use declarative pipeline to refer to a named podTemplate like in JENKINS-48140 but be able to override any part of the podTemplate with app-specific stuff. e.g. if a particular app wanted to use a custom maven version - while reusing the same global podTemplate configuration.
e.g. something like
pipeline { agent { kubernetes { overridePodTemplate { name "fabric8-maven" containerTemplate { name "maven" image "maven:3.5.1" } } } } ... }
i.e. it'd reuse the podTemplate called "fabric8-maven" configured in Manage Jenkins -> Configure System -> Cloud -> Kubernetes -> Pod Templates
then in this case it'd override the image for the container called maven
I'd be able to do a PR myself for this only am not sure how to represent the `overridePodTemplate` class so that it can have > 1 `containerTemplate expressions to override all possible containerTemplates on the podTemplate in declarative markup.
Though I noticed the inheritFrom property on podTemplate so I wonder if something like this is meant to work?
pipeline { agent { kubernetes { podTemplate { inheritFrom "fabric8-maven" containerTemplate { name "maven" image "maven:3.5.1" } } } } ... }
- is related to
-
JENKINS-48140 allow declarative pipelines to refer to a named podTemplate in the Jenkins Kubernetes configuration
- Resolved