Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve the inheritFrom functionality to better cover containers and volumes. #84
This pull request allows a PodTemplate to define a parent template that will be used as a base.
This allows the user to remove repeating/boilerplate code from pipeline and move it in the plugin configuration.
The main benefits are reusability (e.g. don't add the jnlp container everywhere), readability, and more importantly decoupling the pipelines from specific configurations, that might change between environments.
For example: There are environments that may or may not allow the use of hostPath mounts, privileged containers etc. So instead of maintaining two different sets of
@carlossg: I will apply your comments, rebase and squash.
Since, I added this pull request I've been playing a lot with this feature and I am starting to think that it would make sense to be able to inheritFrom multiple parents. So that I can easily compose a pod out of prexisting templates (I think of it as maven profiles). So one could define in the config.xml a template for 'maven', 'golang' etc and then just use that. So the example we have at the readme could then look like:
Would you like to add that feature too?
The problem with using something like:
Of course, this is something we could change if we wanted, but by inheriting podTemplates also allows us to inherit volumes and I can see that being useful too.