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

Do not fail when no docker registry auth is available #2744

Merged
merged 1 commit into from
Jul 6, 2017

Conversation

aep
Copy link
Contributor

@aep aep commented Jun 27, 2017

this amends the behaviour introduced with #2651
and allows pulling public images when docker.auth.helper is set to https://github.com/awslabs/amazon-ecr-credential-helper

this amends the behaviour introduced with hashicorp#2651
and allows pulling public images when docker.auth.helper is set
@rawler
Copy link

rawler commented Jun 27, 2017

So, I guess this is a case of what "makes sense" vs. what "upstream" does.

Personally, if we treat non-zero exit as null return, rather than exceptional, there isn't really a way for scripts to truly HALT the process or signal abnormal errors. Without actual definitions of expected statuses, I think all non-zero statuses should be considered exceptional.

Although, there is naturally also a case for following the upstream precedent. I think this is a perfect example of that. You have my blessing. (But please do also prod the docker guys, so they actually DOCUMENT this)

@aep
Copy link
Contributor Author

aep commented Jun 27, 2017

@rawler I don't mind diverging from upstream behavior. I think this is very specific config anyway.
What would be your preferred way of signaling stopping vs
not stopping ? And why would you want to stop anyway?

At least not stopping should be the default, otherwise there's no way to use dockerhub public images.

@rawler
Copy link

rawler commented Jun 28, 2017 via email

@jippi
Copy link
Contributor

jippi commented Jun 29, 2017

I would personally prefer the current behaviour, i don't want my clients end up in a state where some public containers work, but all private containers fail - i would rather want the entire node to be failing hard and loud :)

@schmichael
Copy link
Member

schmichael commented Jul 6, 2017

Thanks for the PR and great discussion!

I'm going to merge this but then put the behavior behind a task config option for task's using the Docker driver. It will default to the existing behavior of hard failing as I think it's a more secure default to encourage people who have their own repo to rely on it for all of their images.

(Update: This way if you have a task using a public image and you don't want to copy it over: you can just override the behavior for that task.)

@schmichael schmichael merged commit c5e9c4b into hashicorp:master Jul 6, 2017
@schmichael
Copy link
Member

PR up with a test binary if anyone is willing to give it a spin/review: #2786

@aep
Copy link
Contributor Author

aep commented Aug 15, 2017

@schmichael this doesnt seem to be a global config option. setting this in every job configuration is fine but very confusing. A user would still have no idea what to do if an image simply doesn't download from dockerhub, and has no way to figure out that its from a global auth plugin. the docs don't say anything like "if you want to use public images in the same way as docker swarm or kubernetes, set auth_soft_fail".
maybe the config option should be "allow_dockerhub"

@schmichael
Copy link
Member

schmichael commented Aug 15, 2017

@aep Created a new issue #3030 to track this. Definitely is poorly documented and confusing! Implicit fallbacks from private-to-public repos makes me very nervous, but it's worth considering.

Is it unusual for people to import public images into their private hubs for security/latency reasons?

Update: We'll probably rework the auth_soft_fail behavior completely. The UX is pretty bad even with better docs.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants