Skip to content
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

fix docker-credential-gcr helper being called for multiple registries #1439

Merged
merged 2 commits into from
Sep 30, 2020

Conversation

tejal29
Copy link
Member

@tejal29 tejal29 commented Sep 30, 2020

in this Pr,

  • upgrade the docker-credential to v2.0.2 which supports --registries flag and --include-artifact-registry
  • Kaniko, would only configure registry access for the first destination. Fix the presence of user provided docker config outside of loop.
    when we run docker-credential-gcr --registries=<first_registry> docker config file is written at /kaniko/.docker/config.json file is produced. Because the docker config file exists, we never run docker-credential-gcr for subsequent registries.

Test done.
Yes,

I tested locally

  docker run -it --entrypoint /busybox/sh -e GOOGLE_APPLICATION_CREDENTIALS=/kaniko/config.json \
 -v /usr/local/google/home/tejaldesai/.config/gcloud:/root/.config/gcloud  \
 -v /usr/local/google/home/tejaldesai/workspace/tejal-test.json:/kaniko/config.json \
  -v /usr/local/google/home/tejaldesai/workspace/example/my-app:/workspace gcr.io/kaniko-project/executor:debug-kavala
/ # /kaniko/executor -f Dockerfile --context=dir://workspace --destination=gcr.io/tejal-test/test --tarPath=workspa
ce/image.tar --destination=us-central1-docker.pkg.dev/tejal-test/suchist/test:latest --destination=us-central1-docker.pkg.dev/tejal-test/suchist/test:another


Verified an image uploaded to my artifactory.

https://screenshot.googleplex.com/6s3MAZ6kzPit3ir

@googlebot googlebot added the cla: yes CLA signed by all commit authors label Sep 30, 2020
pkg/executor/push.go Outdated Show resolved Hide resolved
@tejal29 tejal29 merged commit 0c386e3 into GoogleContainerTools:master Sep 30, 2020
@tejal29 tejal29 deleted the fix_kavala branch April 26, 2021 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed by all commit authors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants