[JIRA] (JENKINS-57548) Cannot use inheritFrom when PodTemplateContext exists

5 views
Skip to first unread message

hypnoce@donarproject.org (JIRA)

unread,
May 19, 2019, 6:43:03 PM5/19/19
to jenkinsc...@googlegroups.com
Francis JAC created an issue
 
Jenkins / Bug JENKINS-57548
Cannot use inheritFrom when PodTemplateContext exists
Issue Type: Bug Bug
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2019-05-19 22:42
Priority: Minor Minor
Reporter: Francis JAC

When using a nested declarative Kubernetes agent, it implicitly uses the current PodTemplateContext as parent template.

https://github.com/jenkinsci/kubernetes-plugin/blob/46cdc75063dc5617445972a08eaead460457af28/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateStepExecution.java#L85

 

There are 2 situations when this can lead to unexpected behaviors : 

  • declaring explicit inheritFrom will not work without displaying any clear warning
  • When scheduling a pod template on a specific machine, where a limited set of images are allowed to run, it can fail running the slave.

To avoid such situation, what do you think about those 2 solutions : 

  • inheritFrom has priority over template context.
    • When it is empty, no parent context will be used
    • When null, the current template context will be used (current behavior)
    • when non null and not empty, use it as the parent template
  • Add a new option to avoid implicit template inheritance 
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

vincent@latombe.net (JIRA)

unread,
Jun 4, 2019, 5:48:03 AM6/4/19
to jenkinsc...@googlegroups.com
Change By: Vincent Latombe
Status: Open Fixed but Unreleased
Resolution: Fixed

vincent@latombe.net (JIRA)

unread,
Jun 18, 2019, 5:34:05 AM6/18/19
to jenkinsc...@googlegroups.com
Change By: Vincent Latombe
Status: Fixed but Unreleased Closed
Released As: 1.15.7
Reply all
Reply to author
Forward
0 new messages