-
Bug
-
Resolution: Unresolved
-
Major
-
None
I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.
The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails.
Steps to reproduce:
1. Configure a pipeline job with a string parameter called `BRANCH`
2. For the pipeline definition, configure it to use "Pipeline script from SCM"
3. Use the `Git` SCM and configure it to point to your repo
4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called
5. Specify your Jenkinsfile path
– Specify the pod template using `yamlFile`
6. `Lightweight checkout` should be unchecked
7. Attempt to build the job
Stripped down version of my jenkinsfile: Jenkinsfile
[JENKINS-71742] Git fetch when pulling pod template fails when the "Branch Specifier" is an env var
Attachment | New: Screenshot 2023-07-31 at 12.45.38 PM.png [ 60919 ] |
Description |
Original:
I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.
!image-2023-07-31-12-53-13-112.png! The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails. *Steps to reproduce:* 1. Configure a pipeline job with a string parameter called `BRANCH` !image-2023-07-31-11-33-15-822.png! 2. For the pipeline definition, configure it to use "Pipeline script from SCM" 3. Use the `Git` SCM and configure it to point to your repo !image-2023-07-31-12-53-40-884.png! 4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called !image-2023-07-31-12-53-13-112.png! 5. Specify your Jenkinsfile path -- Specify the pod template using `yamlFile` 6. `Lightweight checkout` should be unchecked 7. Attempt to build the job |
New:
I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.
!image-2023-07-31-12-53-13-112.png! The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails. *Steps to reproduce:* 1. Configure a pipeline job with a string parameter called `BRANCH` !image-2023-07-31-11-33-15-822.png! 2. For the pipeline definition, configure it to use "Pipeline script from SCM" 3. Use the `Git` SCM and configure it to point to your repo !image-2023-07-31-12-53-40-884.png! 4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called !image-2023-07-31-12-53-13-112.png! 5. Specify your Jenkinsfile path – Specify the pod template using `yamlFile` 6. `Lightweight checkout` should be unchecked !Screenshot 2023-07-31 at 12.45.38 PM.png|thumbnail! 7. Attempt to build the job |
Attachment | New: Jenkinsfile [ 60920 ] |
Description |
Original:
I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.
!image-2023-07-31-12-53-13-112.png! The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails. *Steps to reproduce:* 1. Configure a pipeline job with a string parameter called `BRANCH` !image-2023-07-31-11-33-15-822.png! 2. For the pipeline definition, configure it to use "Pipeline script from SCM" 3. Use the `Git` SCM and configure it to point to your repo !image-2023-07-31-12-53-40-884.png! 4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called !image-2023-07-31-12-53-13-112.png! 5. Specify your Jenkinsfile path – Specify the pod template using `yamlFile` 6. `Lightweight checkout` should be unchecked !Screenshot 2023-07-31 at 12.45.38 PM.png|thumbnail! 7. Attempt to build the job |
New:
I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.
!image-2023-07-31-12-53-13-112.png! The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails. *Steps to reproduce:* 1. Configure a pipeline job with a string parameter called `BRANCH` !image-2023-07-31-11-33-15-822.png! 2. For the pipeline definition, configure it to use "Pipeline script from SCM" 3. Use the `Git` SCM and configure it to point to your repo !image-2023-07-31-12-53-40-884.png! 4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called !image-2023-07-31-12-53-13-112.png! 5. Specify your Jenkinsfile path – Specify the pod template using `yamlFile` 6. `Lightweight checkout` should be unchecked !Screenshot 2023-07-31 at 12.45.38 PM.png|thumbnail! 7. Attempt to build the job Stripped down version of my jenkinsfile: [^Jenkinsfile] |
Attachment | New: image-2023-07-31-13-08-30-126.png [ 60921 ] |
Description |
Original:
I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.
!image-2023-07-31-12-53-13-112.png! The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails. *Steps to reproduce:* 1. Configure a pipeline job with a string parameter called `BRANCH` !image-2023-07-31-11-33-15-822.png! 2. For the pipeline definition, configure it to use "Pipeline script from SCM" 3. Use the `Git` SCM and configure it to point to your repo !image-2023-07-31-12-53-40-884.png! 4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called !image-2023-07-31-12-53-13-112.png! 5. Specify your Jenkinsfile path – Specify the pod template using `yamlFile` 6. `Lightweight checkout` should be unchecked !Screenshot 2023-07-31 at 12.45.38 PM.png|thumbnail! 7. Attempt to build the job Stripped down version of my jenkinsfile: [^Jenkinsfile] |
New:
I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.
!image-2023-07-31-12-53-13-112.png|width=322,height=146! The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails. !image-2023-07-31-13-08-30-126.png|width=1215,height=521! *Steps to reproduce:* 1. Configure a pipeline job with a string parameter called `BRANCH` !image-2023-07-31-11-33-15-822.png|width=424,height=177! 2. For the pipeline definition, configure it to use "Pipeline script from SCM" 3. Use the `Git` SCM and configure it to point to your repo !image-2023-07-31-12-53-40-884.png|width=621,height=293! 4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called !image-2023-07-31-12-53-13-112.png|width=322,height=146! 5. Specify your Jenkinsfile path – Specify the pod template using `yamlFile` 6. `Lightweight checkout` should be unchecked !Screenshot 2023-07-31 at 12.45.38 PM.png|thumbnail! 7. Attempt to build the job Stripped down version of my jenkinsfile: [^Jenkinsfile] |
Component/s | New: git-plugin [ 15543 ] | |
Component/s | Original: kubernetes-plugin [ 20639 ] |
Description |
Original:
I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.
!image-2023-07-31-12-53-13-112.png|width=322,height=146! The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails. !image-2023-07-31-13-08-30-126.png|width=1215,height=521! *Steps to reproduce:* 1. Configure a pipeline job with a string parameter called `BRANCH` !image-2023-07-31-11-33-15-822.png|width=424,height=177! 2. For the pipeline definition, configure it to use "Pipeline script from SCM" 3. Use the `Git` SCM and configure it to point to your repo !image-2023-07-31-12-53-40-884.png|width=621,height=293! 4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called !image-2023-07-31-12-53-13-112.png|width=322,height=146! 5. Specify your Jenkinsfile path – Specify the pod template using `yamlFile` 6. `Lightweight checkout` should be unchecked !Screenshot 2023-07-31 at 12.45.38 PM.png|thumbnail! 7. Attempt to build the job Stripped down version of my jenkinsfile: [^Jenkinsfile] |
New:
I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.
!image-2023-07-31-12-53-13-112.png|width=322,height=146! The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails. !image-2023-07-31-13-08-30-126.png|width=1215,height=521! *Steps to reproduce:* 1. Configure a pipeline job with a string parameter called `BRANCH` !image-2023-07-31-11-33-15-822.png|width=424,height=177! 2. For the pipeline definition, configure it to use "Pipeline script from SCM" 3. Use the `Git` SCM and configure it to point to your repo !image-2023-07-31-12-53-40-884.png|width=621,height=293! 4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called !image-2023-07-31-12-53-13-112.png|width=322,height=146! 5. Specify your Jenkinsfile path – Specify the pod template using `yamlFile` 6. `Lightweight checkout` should be unchecked !Screenshot 2023-07-31 at 12.45.38 PM.png|thumbnail! 7. Attempt to build the job Stripped down version of my jenkinsfile: [^Jenkinsfile] |
Hi markewaite, is there any additional information I can provide to help with this? Thanks!