-
Bug
-
Resolution: Unresolved
-
Critical
-
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.
Please provide a Jenkinsfile that reproduces the problem.