[image-builder] Fix error when secret is a json #10031
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The credentials from decoded auth string should be split in such a way that the first substring is treated as username and the rest of the string as password/secret. This is in conformance with what we have in image-builder-bob.
Related Issue(s)
Fixes #8938
How to test
Prefer testing in workspace-preview due to known issues (see following
Known Caveats
section)The json key secret is used in GAR/GCR. It allows you to use your service account key as a json key secret for docker login. Read more here.
I am not aware of any other such registry services which accepts a json key as a secret. In any case this PR should solve any issues whether a registry service accepts a json key or a yaml or a plain string.
cat key.json | docker login us-docker.pkg.dev -u _json_key --password-stdin
.gitpod.yml
~/.docker/config
) and copy the auth base64encoded string and use it as per instructions of this PR. Your workspace should start now.Working example
Known Caveats
europe-docker.pkg.dev
andeu.gcr.io
in our pull secrets. If you create a private registry in any of these registries then your image build will fail due to incorrect key.Release Notes
Documentation