Skip to content

Allow username/password in config file#2122

Merged
vdemeester merged 3 commits into
docker:masterfrom
jonjohnsonjr:passthrough-user-pass
Oct 17, 2019
Merged

Allow username/password in config file#2122
vdemeester merged 3 commits into
docker:masterfrom
jonjohnsonjr:passthrough-user-pass

Conversation

@jonjohnsonjr

Copy link
Copy Markdown
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.

@jonjohnsonjr

Copy link
Copy Markdown
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
Copy Markdown

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

@vdemeester vdemeester left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🐯

Comment thread cli/config/configfile/file_test.go Outdated

@silvin-lubecki silvin-lubecki left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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 <[email protected]>
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