V2 registry fallback#18
Conversation
|
LGTM! |
b9b4f6c to
6c30456
Compare
|
@stevvooe I fixed up your commit to get it to compile, was expected a string array instead of just a string, see Tested and it does fallback when endpoint not found is returned, still need to test when /v2/ returns a 404 |
6c30456 to
1dca7b6
Compare
|
@dmcgowan Sounds great. Do you need a registry that has this behavior or can you mock with |
|
@stevvooe the plan right now is to mock it. The only way I have tested so far is to force the error through altering the code. |
1dca7b6 to
65615da
Compare
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
To allow remotes to understand the operation being carried out during an API request to the registry, we've added a header indicating the engine command. Mostly, this is advisory but a registry may take action based on the field. This changeset only adds this for the "push" command. Signed-off-by: Stephen J Day <stephen.day@docker.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
829b51f to
c23b58c
Compare
|
Tested and added a fix to an error discovered in testing. Tested using nginx in front of a v1 and v2 registry and forcing a 404 when the push header is given. |
There was a problem hiding this comment.
Dirty. I really don't like it but doing it right will require (imo) the refactor we discussed, having the endpoint be the top level value from which sessions and factories are derived.
|
LGTM! |
Add support for fallback to v1 on push
An HTTP header "Docker-Command" is added to specify the command as "push". When the server returns a 404 from the v2 endpoint, the client should fallback to v1 and push to the v1 endpoint.