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

When using "Git Parameter PlugIn" and "Kubernetes PlugIn" at the same time, the variables in "Branches to build" cannot be assigned values

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • kubernetes-plugin
    • None
    • Jenkins 2.235.5
      Kubernetes plugin 1.27.0

      When using "Git Parameter PlugIn" and "Kubernetes PlugIn" at the same time, in the case of "Pipeline script from SCM", "Branches to build" will generally be set to the Git Parameter variable name, such as: ${branch_name}, But an error occurs when building the task:
      Pipeline] Start of Pipeline
      [Pipeline] readTrusted
      [Pipeline] End of Pipeline
      hudson.plugins.git.GitException: Command "git fetch --tags --progress --prune origin +refs/heads/${branch_name}:refs/remotes/origin/${branch_name}" returned status code 128:
      stdout:
      stderr: fatal: Couldn't find remote ref refs/heads/${branch_name}
      Unexpected end of command stream

      ${branch_name} can be used in Pipeline, because there is no problem when executing "Pipeline" at the top:
      > git --version # timeout=10
      > git --version #'git version 1.8.3.1'
      > git fetch --tags --progress http://git.bluersw.com/dev/gitlab.git +refs/heads/:refs/remotes/origin/ # timeout=10
      > git rev-parse refs/remotes/origin/test^{commit} # timeout=10
      > git rev-parse refs/remotes/origin/origin/test^{commit} # timeout=10
      Checking out Revision f7131ece6f66f7e57d53d297209326e45196596d (refs/remotes/origin/test)

      At the beginning, "Pipeline" was executed without problems. "/origin/test" was the branch I chose, but when I needed "Kubernetes PlugIn" to execute, there was an error, so I felt that "Kubernetes PlugIn" did not get the branch. Variable assignment.
      Please tell me the solution, thank you very much.

          [JENKINS-63558] When using "Git Parameter PlugIn" and "Kubernetes PlugIn" at the same time, the variables in "Branches to build" cannot be assigned values

          Sun WeiSheng created issue -
          Sun WeiSheng made changes -
          Priority Original: Minor [ 4 ] New: Critical [ 2 ]

            Unassigned Unassigned
            bluersw Sun WeiSheng
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: