Fixes layer MediaTypes in manifests created from a cross-repository push#19509
Merged
tiborvass merged 1 commit intomoby:masterfrom Jan 22, 2016
Merged
Fixes layer MediaTypes in manifests created from a cross-repository push#19509tiborvass merged 1 commit intomoby:masterfrom
tiborvass merged 1 commit intomoby:masterfrom
Conversation
|
LGTM |
Signed-off-by: Brian Bland <[email protected]>
Contributor
Author
|
Also added checks for digest equivalence in x-repo push integration tests |
Contributor
|
LGTM |
1 similar comment
Contributor
|
LGTM |
tiborvass
added a commit
that referenced
this pull request
Jan 22, 2016
Fixes layer MediaTypes in manifests created from a cross-repository push
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While testing cross-repository pushing on staging, I discovered that the manifest generated from a cross-repository push differs from that of a standard push or one where the layers already exist. This change overrides the mediatype returned from checking the blob stat on the registry, just like what happens when checking for layers which already exist.
Inspecting the manifests revealed that the only difference was the mediaType fields for each layer.
Original:
{ "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/octet-stream", "size": 2946, "digest": "sha256:1c9b046c28502c1d1267a7cfda7d89d29c9469d66e886cd79b34b9d03ed4d29d" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 65674854, "digest": "sha256:d89e1bee20d9cb344674e213b581f14fbd8e70274ecf9d10c514bab78a307845" }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 71476, "digest": "sha256:9e0bc8a71bde464f710bc2b593a1fc21521517671e918687892303151331fa56" }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 682, "digest": "sha256:27aa681c95e5165caf287dcfe896532df4ae8b10e099500f2f8f71acf4002a89" }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 32, "digest": "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4" } ] }X-Repo:
{ "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/octet-stream", "size": 2946, "digest": "sha256:1c9b046c28502c1d1267a7cfda7d89d29c9469d66e886cd79b34b9d03ed4d29d" }, "layers": [ { "mediaType": "application/octet-stream", "size": 65674854, "digest": "sha256:d89e1bee20d9cb344674e213b581f14fbd8e70274ecf9d10c514bab78a307845" }, { "mediaType": "application/octet-stream", "size": 71476, "digest": "sha256:9e0bc8a71bde464f710bc2b593a1fc21521517671e918687892303151331fa56" }, { "mediaType": "application/octet-stream", "size": 682, "digest": "sha256:27aa681c95e5165caf287dcfe896532df4ae8b10e099500f2f8f71acf4002a89" }, { "mediaType": "application/octet-stream", "size": 32, "digest": "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4" } ] }