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

docker-credential-gcr produces Username incompatible with GCR when used by other libraries #2251

Closed
dinvlad opened this issue Sep 15, 2022 · 0 comments · Fixed by #2531
Closed
Labels
area/behavior all bugs related to kaniko behavior like running in as root area/released-image dependencies Pull requests that update a dependency file kind/bug Something isn't working priority/p2 High impact feature/bug. Will get a lot of users happy
Milestone

Comments

@dinvlad
Copy link

dinvlad commented Sep 15, 2022

Actual behavior
echo https://gcr.io | docker-credential-gcr get produces output like this:

{"ServerURL":"https://gcr.io","Username":"_dcgcr__token","Secret":"<redacted_oauth_token>"}

When using this helper with other libraries like Jib, they fail to successfully authenticate against GCR because GCR would not accept the username in the format _dcgcr__token (note the 2 _s between dcgcr and token).

But when docker-credential-gcr is build from the latest source, it produces Username in the format _dcgcr_2_0_4_token,
which is accepted by GCR when using basic auth.

Expected behavior
docker-credential-gcr get should produce Username that has version between dcgcr and token, which works with GCR.

To Reproduce
Please see the commands above.

Additional Information

  • Dockerfile
    N/A
  • Build Context
    N/A
  • Kaniko Image (fully qualified with digest)
    gcr.io/kaniko-project/executor@sha256:a3f8c85c6a0fa490b9a619bdb503c8cb98fb2fd17f96d0e4356a0bd65c1e5056 (:debug)
    gcr.io/kaniko-project/executor@sha256:1f982af0b54be748221d9a35dcfa608660ab3d51229aa56bde5416f75aff7561 (:latest)

I believe this issue is due to the version information somehow not being bundled with the build used (even though it shows up as v1.5.1-0.20210909233216-4cdd60d0f2d8 on version command).

I would suggest to update the binary to the latest version and make sure it outputs Username in the right format.

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@aaron-prindle aaron-prindle added area/released-image dependencies Pull requests that update a dependency file priority/p2 High impact feature/bug. Will get a lot of users happy area/behavior all bugs related to kaniko behavior like running in as root kind/bug Something isn't working labels May 30, 2023
@aaron-prindle aaron-prindle added this to the v1.11.0 milestone May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/behavior all bugs related to kaniko behavior like running in as root area/released-image dependencies Pull requests that update a dependency file kind/bug Something isn't working priority/p2 High impact feature/bug. Will get a lot of users happy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants