-
Notifications
You must be signed in to change notification settings - Fork 395
Fix requested token actions when deleting images #487
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
Conversation
bcbc860 to
9b62cb3
Compare
|
Maybe I messed something up in my compilation, but the change doesn't seem to fix the problem for me, it only changes the error. |
|
and without tls-verify |
|
Yes, this is known, as noted in containers/skopeo#531 . I’m sorry, I forgot to mention it here. When the server does not implement deletes at all, there’s not much we can do; the operation can succeed only against a registry which implements deleting images. Running We do at least one |
|
LGTM |
|
Thanks for the info @mtrmac , I threw --debug on the command line and did indeed see the DELETE command get attempted when deleting from dockerhub. It still failed though as you suspected. I tried Quay.io too and got a 400 failure there and did not see the DELETE command. Thought I'd throw it by you in case it's of concern for skopeo and/or something we should try adjusting on quay.io. If I replace delete with inspect I see the info on the image fwiw. |
|
@runcom how do I get on the approved list for merging? |
Yes, that does not look too good. I’ll look into it. |
9b62cb3 to
620400e
Compare
So (keep in mind that we are in undocumented territory in all of this), it turns out that Quay requires the Luckily, it seems that both new docker/distribution and quay.io support |
620400e to
82b74a5
Compare
|
@runcom PTAL |
|
@mtrmac LGTM, up to you to merge now |
https://github.com/docker/distribution/blob/master/docs/spec/auth/scope.md does not document the action necessary for deleting images. For docker/distribution, we need "pull" to be able to read the manifest, and "delete" to delete it. Until docker/distribution commit ccb839e0e30c3b6992fb4084dfd6550d0ddd4d1a (Jan 3 2017), the action checked for deleting manifests was "*". For Quay.io, only "push" is sufficient for both; and although https://github.com/docker/distribution/blob/master/docs/spec/auth/jwt.md says that requesting permissions that the server does not grant should not be an error, quay.io refuses to even parse a request which contains a "delete" action and does not grant any token. This should not affect OpenShift, where the token is an API token and does not actually include any scopes or permissions; (that is also probably why noone has noticed before). Overall, "*" seems to be the only common action specification; luckily both docker/distribution and Quay.io seem to treat it as "all actions allowed" (which is _not_ documented in the spec, but then again, nothing about actions for deleting images is documented). Signed-off-by: Miloslav Trmač <[email protected]>
82b74a5 to
e43b271
Compare
We need
"pull"to be able to read the manifest, and"delete"to delete it.Note that until docker/distribution commit ccb839e0e30c3b6992fb4084dfd6550d0ddd4d1a (Jan 3 2017), the action checked for deleting manifests was
"*"; this does not add it.(Also, neither of these actions are documented at https://github.com/docker/distribution/blob/master/docs/spec/auth/scope.md . At least https://github.com/docker/distribution/blob/master/docs/spec/auth/jwt.md says that requesting permissions that the server does not grant should not be an error, so this kind of non-compliance is hopefully safe enough.)
This should not affect OpenShift, where the token is an API token and does not actually include any scopes or permissions; that is also probably why noone has noticed before.
@jwhonce @runcom PTAL