-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kaniko v1.7.0 fails to clone private git repositories when specifying a specific branch #1801
Comments
I suppose this might have bin introduced by #1765 as it is editing |
Same, workaround: |
@sesky4 thank you for the workaround. I thought about it before, but haven’t tested it as me and probably a lot of other people would need to change a lot of ci/cd scripts to get the commit hash everytime. |
I have very similar issue using: And starting from 1.7.0, it goes against always Update: |
Similar issue when cloning specific tags.
|
Proposing a fix in #1823 Corresponding docker image integrating the patch: https://hub.docker.com/r/gcalmettes/kaniko/tags |
Actual behavior
I use kaniko to build images from Dockerfiles hold in a private git repository. I need to authenticate to access them. Furthermore I would like to be able to specify the branch used by adding
#refs/heads/<branch-name>
to the context parameter. This works well with kaniko in version 1.6.0, it fails in version 1.7.0.If you do not specify the branch with
#refs/heads/<branch-name>
or do use a public repository without authentication, the error does not appear.Expected behavior
It should be possible to build images from specify specific branches of private git repositories.
To Reproduce
Steps to reproduce the behavior:
docker run -it --rm --entrypoint "" gcr.io/kaniko-project/executor:v1.7.0-debug sh -c 'GIT_PULL_METHOD=https GIT_USERNAME=<your-name> GIT_PASSWORD=<your access token> /kaniko/executor --context "git://<git-repo-url>/<git-repo-path>#refs/heads/<branch name>" --context-sub-path "postgres" --no-push --verbosity debug'
This will clone the git repository and then still fail complaining about authentication:
docker run -it --rm --entrypoint "" gcr.io/kaniko-project/executor:v1.6.0-debug sh -c 'GIT_PULL_METHOD=https GIT_USERNAME=<your-name> GIT_PASSWORD=<your access token> /kaniko/executor --context "git://<git-repo-url>/<git-repo-path>#refs/heads/<branch name>" --context-sub-path "postgres" --no-push --verbosity debug'
This runs like a charme.
Additional Information
Dockerfile
You can use and Dockerfile
FROM postgres
is a good exampleBuild Context
Kaniko Image (fully qualified with digest)
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: