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: fix a bug where auth for private registries wasn't parsed correctly #24215

Merged
merged 16 commits into from
Oct 16, 2024

Conversation

pkazmierczak
Copy link
Contributor

In #23966 we introduced an official Docker client and did not notice that in contrast to our previous 3rd party client, the official SDK PullOptions object expects a base64 encoded JSON with username and password, instead of username/password pair.

This PR fixes the issue and adds e2e tests for Docker driver auth.

Fixes #24181
Internal ref: https://hashicorp.atlassian.net/browse/NET-11310

@pkazmierczak pkazmierczak self-assigned this Oct 15, 2024
@pkazmierczak pkazmierczak added this to the 1.9.1 milestone Oct 15, 2024
drivers/docker/utils.go Outdated Show resolved Hide resolved
drivers/docker/utils.go Outdated Show resolved Hide resolved
t.Cleanup(cleanup)

logs := job.TaskLogs("cache", "redis")
must.StrContains(t, logs.Stdout, "oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo")
Copy link
Member

Choose a reason for hiding this comment

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

👻

drivers/docker/utils.go Outdated Show resolved Hide resolved
@pkazmierczak
Copy link
Contributor Author

One other thing: the e2e tests are failing because the local registry isn't added to dockerd's "insecure registries." I'm not sure how to add it since we only know the registry address once we create it, I'll have to think about it.

@shoenig
Copy link
Member

shoenig commented Oct 15, 2024

The podman e2e test jumps through some fun hoops to setup a private registry that is auth enabled, can take a look for inspiration maybe. https://github.com/hashicorp/nomad/blob/main/e2e/podman/input/registry-auths.hcl

@gjrtimmer
Copy link

I had to rollback to 1.8.4, this issues caused several hours of downtime. When is this going to be fixed?

@tgross
Copy link
Member

tgross commented Oct 16, 2024

@gjrtimmer it should be obvious that this is actively being worked on. Updates on when this will be shipped will be posted to the original issue when available. If you skipped pre-production testing, please reach out to your Enterprise support contact if any to get help in rolling back if you need it.

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM, nice work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker auth.config not working anymore in 1.9.0
4 participants