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

Nomad Docker driver silently discards auth when no key found #1662

Closed
evan2645 opened this issue Aug 29, 2016 · 11 comments · Fixed by #2190
Closed

Nomad Docker driver silently discards auth when no key found #1662

evan2645 opened this issue Aug 29, 2016 · 11 comments · Fixed by #2190

Comments

@evan2645
Copy link
Contributor

Nomad version

0.4.1-rc1

Operating system and Environment details

Ubuntu 16.04
Docker 1.12.0

Issue

When Nomad is configured to use docker authentication credentials through the use of the docker.auth.config driver option, but no auth key exists for the requested image, it silently falls back.

Expected Behavior

A debug message is logged.

I ran into this while trying to debug why my private repo credentials were not working under Nomad. They worked when interacting Docker directly. It seems that Docker does not mandate the use of the https:// prefix in the auths config for SSL repos, but Nomad does. In addition to debug logging, an update to the docker documentation for docker.auth.config driver option to specify the requirement would have saved a lot of time.

@dadgar dadgar added this to the v0.5.1 milestone Aug 29, 2016
@evan2645
Copy link
Contributor Author

Perhaps another option might be to mirror native docker behavior in auth key selection, since the lack of parity there was one of the other unexpected results

@dadgar
Copy link
Contributor

dadgar commented Aug 30, 2016

Can you expand on how they are treated differently?

@evan2645
Copy link
Contributor Author

When using the docker binary and passing the auths config file, it uses the quay.io auth configuration key even though it is https under the hood. Nomad consumes this file directly, and requires the use of https:// prefix on the auth key. In this way, an auth config with key quay.io works with the docker binary but not nomad.

@evan2645
Copy link
Contributor Author

Here is an example of a configuration file which worked with docker binary but not nomad:

{
 "quay.io": {
  "auth": "REDACTED",
  "email": ""
 }
}

@gliptak
Copy link
Contributor

gliptak commented Nov 23, 2016

Would an else DEBUG log at https://github.com/hashicorp/nomad/blob/master/client/driver/docker.go#L910 be an acceptable change? Thanks

@dadgar
Copy link
Contributor

dadgar commented Nov 28, 2016

I think we can do a bit better job parsing the key in the docker driver

@gliptak
Copy link
Contributor

gliptak commented Nov 28, 2016

@dadgar So would it need to be prefixed with https:// if protocol wasn't specified (to match Docker's behaviour)?

@dadgar
Copy link
Contributor

dadgar commented Nov 28, 2016

@gliptak Yep that would be the first thought. I want to see how docker does it itself too

@dadgar
Copy link
Contributor

dadgar commented Jan 23, 2017

@evan2645 This PR makes Nomad behave the same as docker: #2190

@evan2645
Copy link
Contributor Author

WooHoo!! Thank you @dadgar

@tgross tgross modified the milestones: near-term, unscheduled Jan 9, 2020
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants