The Wayback Machine - https://web.archive.org/web/20251014204437/https://github.com/docker/cli/pull/2122
Skip to content

Conversation

jonjohnsonjr
Copy link
Contributor

- What I did

Only decode auth if it is present. Currently, this overwrites username and password fields, even if auth is empty.

Fixes google/go-containerregistry#555

- How I did it

Guard decodeAuth with an empty string check.

- How to verify it

Run the unit test :)

Alternatively, modify your config file to use username/password instead of auth and try it. I have a branch here which seems to work when I try it 👍

- Description for the changelog
Fix reading config files containing "username" and "password" auth.

Signed-off-by: Jon Johnson <jonjohnson@google.com>
@jonjohnsonjr
Copy link
Contributor Author

ping @tiborvass

Came across this when I switched over to using docker/cli for config file parsing. Docker seems to ignore the username/password fields from a config file if they're set directly instead of the "auth" field.

@max-wittig
Copy link

@silvin-lubecki @chris-crone @vdemeester Could you please take a look at this small fix. It would really help. Thanks!

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

Signed-off-by: Jon Johnson <jonjohnson@google.com>
Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@silvin-lubecki
Copy link
Contributor

@jonjohnsonjr linter is complaining

cli/config/configfile/file_test.go:1::warning: file is not gofmted with -s (gofmt)

Signed-off-by: Jon Johnson <jonjohnson@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auth broke in GitLab CI

6 participants