Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-71742

Git fetch when pulling pod template fails when the "Branch Specifier" is an env var

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • 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

          Tommy added a comment -

          Hi markewaite, is there any additional information I can provide to help with this? Thanks!

          Tommy added a comment - Hi markewaite , is there any additional information I can provide to help with this? Thanks!

          Mark Waite added a comment -

          thnguyen I don't plan to investigate this. I don't have easy access to a Kubernetes cluster with a YAML template. I assume the issue is in the kubernetes plugin rather than in the git plugin, but I'm not planning to investigate that in order to confirm my theory.

          Mark Waite added a comment - thnguyen I don't plan to investigate this. I don't have easy access to a Kubernetes cluster with a YAML template. I assume the issue is in the kubernetes plugin rather than in the git plugin, but I'm not planning to investigate that in order to confirm my theory.

            Unassigned Unassigned
            thnguyen Tommy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: