-
Bug
-
Resolution: Not A Defect
-
Blocker
-
None
-
Jenkins environment:
Kubernetes 1.26.5
Jenkins core: 2.479.1 LTS
Git plugin: 5.6.0
List Git branches Parameter plugin: 0.0.13
Choice Parameter plugin: build-in core release
Git plugin not clone on Kubernetes platform when using parameter as Branch Specifier to clone from.
Git plugin does not clone to NFS path when using Jenkins slave as pod.
–
I declare checkoutBranch as parameter (It can be choice parameter or List git branches parameter)
in Branch Specifier I wrote ${checkoutBranch}
when Jenkins job executed on Jenkins master git plugin run a several command the git fetch command correctly
git fetch --tags --force --progress – <repository url> +refs/heads/:refs/remotes/origin/ # timeout=10
but after “Start of Pipeline” the git fetch command failed and in log the git fetch appear as part of the git fetch command and not the correct branch name
“git fetch --tags --force --progress – <repository url> +refs/heads/:refs/remotes/origin/${checkoutBranch}{*}” # timeout=10
assumption
the workspace that the Jenkins pod connect to is an NFS path, so I think that if we will add the command of git add safe.directory to run before doing git fetch it will know that the path is safe directory (the full workspace path to clone into).
git config --global --add safe.directory "*"
I don’t know how to do it.