-
Notifications
You must be signed in to change notification settings - Fork 202
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
Fix login/logout for docker.io/user #757
Conversation
`reference.ParseNamed()` fails on `docker.io/user` because it expects `docker.io/library/user`. We handle this special case now by changing the domain prefix to always include `/library/`. Signed-off-by: Sascha Grunert <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if c/image wouldn't be a better home for it. Preserving this logic seems crucial but if it's scattered across projects, we may run into regressions down the road.
Code LGTM. @mtrmac PTAL
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAK, AFAICS this changes semantics: Everywhere else, example.com/vendor
would match example.com/vendor/product
, but with this, docker.io/vendor
would not match docker.io/vendor/product
(but would match docker.io/library/vendor
).
(This should be clearly visible in a unit test; this PR should add some for docker.io
, however it is resolved.)
The fact that reference.Named
can only with difficulty represent docker.io/vendor
is a problem for auth.go
specifically (and not most of other code, but also not exclusively to auth.io
) because it uses GetCredentialsForRef
to read namespaced values (GetCredentials
is currently explicitly unable to do that).
[Still, to be clear, GetCredentialsForRef
is what almost all callers should use to read credentials, and that API is, I think, OK for that purpose.]
I’m not 100% sure what to do here. One way would be to just work harder to create a reference.Named
for docker.io/vendor[/*]
, probably reference.Parse
+ some more type checks, another would be to make GetCredentials
support namespaced keys; that would be consistent with the rest of that package, and mostly EDIT reduce the need for auth.go
to deal with reference.Named
at all (other than a check for domain match, and tag/digest, which can be done with ParseNormalizedNamed
fine); I lean towards the latter because it makes auth.go
simpler and more consistent.
Not for the “add a (We have more and more instances of “repo prefix” strings, so sharing a single strict parser for that, and not using But for the purposes of this PR, I don’t think it matters that much: we would still want to provide a |
Also, while it’s possible to create a |
Folks I'd like to let you know that I'm on vacation the next three weeks until Oct 4. So either we wait until I'm back or someone else has to take it over if it's critical. |
containers/image#1373 will allow that. |
See #763 . |
Thank you! I'll close this one for now to avoid confusion. |
reference.ParseNamed()
fails ondocker.io/user
because it expectsdocker.io/library/user
. We handle this special case now by changingthe domain prefix to always include
/library/
.Refers to containers/buildah#3500