-
Bug
-
Resolution: Fixed
-
Major
-
None
-
-
1.12.7
Test case
A Pipeline script job as follows, The aim of this pipeline is to show the feature of inheritFrom :
podTemplate(cloud: 'openshift', inheritFrom: 'nodejs', name: 'nodejs-p', label: 'nodejs-p', volumes: [ persistentVolumeClaim(mountPath: '/home/jenkins/.npm', claimName: 'nodejs', readOnly: false) ]) { node("nodejs-p") { stage('BuildFrontend') { // some commands } } } podTemplate(cloud: 'openshift', inheritFrom: 'maven', name: 'maven-p', label: 'maven-p', volumes: [ persistentVolumeClaim(mountPath: '/home/jenkins/.m2', claimName: 'maven', readOnly: false) ]) { node("maven-p") { stage('BuildBackend') { // some commands } } }
Outcome
The first podTemplate definition works as expected.
The second podTemplate starts, but instead of using the inheritFrom defined ('maven') it is using the 'nodejs-p' as parent.
As you guess is wrong and because the nodejs-p template is temporary, the plugin starts the default jenkins-slave container.
If you invert the podTemplate definitions inside the pipeline, so first maven-p and second nodejs-p you obtain the same behaviour. The first works as expected and the second fails.
It looks like a race condition issue.
Plugin-Version: 0.10 Hudson-Version: 2.7.4 Jenkins-Version: 2.7.4
Plugin-Version: 1.0 Hudson-Version: 2.32.1 Jenkins-Version: 2.32.1
- is duplicated by
-
JENKINS-42184 Unable to run pods in parallel due to template nesting
- Closed
-
JENKINS-50932 `hostPort` only works for one pod at a time
- Closed
-
JENKINS-53908 InheritFrom does not behave as it should
- Closed
- links to