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
Limit v1 protocol fallbacks #18590
Limit v1 protocol fallbacks #18590
Conversation
73ddd0c
to
d178cf8
Compare
I've looked through the code earlier today and seems reasonable. One question--is there anything user facing (other than the messages being updated in the 2nd commit) that needs to be mentioned in docs? Is behavior changing in any way that will be different than any docs we have on registry interactions? I'm being lazy by not looking myself, but that's what came to mind when I was reviewing. |
I don't believe the fallback logic (or pull/push in general for that matter) is documented in any significant detail. When I looked at the CLI documentation for |
d178cf8
to
6577221
Compare
Rebased. |
@@ -78,6 +80,10 @@ func (p *v2Puller) pullV2Repository(ctx context.Context, ref reference.Named) (e | |||
return err | |||
} | |||
|
|||
// If theis call succeeded, we can be confident that the |
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.
typo
LGTM |
6577221
to
0cdf688
Compare
LGTM |
…V2 registry If we detect a Docker-Distribution-Api-Version header indicating that the registry speaks the V2 protocol, no fallback to V1 should take place. The same applies if a V2 registry operation succeeds while attempting a push or pull. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
- Use layer DiffIDs for progress output in v1 push. This makes the output consistent with v2 pushes, which means that a fallback to v1 won't start progress bars for a different set of IDs. - Change wording used in v1 status updates to be consistent with v2. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
0cdf688
to
891bbc1
Compare
Rebased. |
LGTM |
@aaronlehmann This breaks compatibility at Docker head in ways that weren't discussed as part of the deprecation plan. |
PR moby#18590 caused compatibility issues with registries such as gcr.io which support both the v1 and v2 protocols, but do not provide the same set of images over both protocols. After moby#18590, pulls from these registries would never use the v1 protocol, because of the Docker-Distribution-Api-Version header indicating that v2 was supported. Fix the problem by making an exception for the case where a manifest is not found. This should allow fallback to v1 in case that image is exposed over the v1 protocol but not the v2 protocol. This avoids the overly aggressive fallback behavior before moby#18590 which would allow protocol fallback after almost any error, but restores interoperability with mixed v1/v2 registry setups. Fixes moby#18832 Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
PR moby#18590 caused compatibility issues with registries such as gcr.io which support both the v1 and v2 protocols, but do not provide the same set of images over both protocols. After moby#18590, pulls from these registries would never use the v1 protocol, because of the Docker-Distribution-Api-Version header indicating that v2 was supported. Fix the problem by making an exception for the case where a manifest is not found. This should allow fallback to v1 in case that image is exposed over the v1 protocol but not the v2 protocol. This avoids the overly aggressive fallback behavior before moby#18590 which would allow protocol fallback after almost any error, but restores interoperability with mixed v1/v2 registry setups. Fixes moby#18832 Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Two commits:
and: