fetch: Use data from descriptor when available.#8076
Merged
fuweid merged 1 commit intocontainerd:mainfrom Feb 10, 2023
Merged
Conversation
0c3c4e3 to
265ea8e
Compare
tianon
approved these changes
Feb 10, 2023
Member
tianon
left a comment
There was a problem hiding this comment.
Not a maintainer, but very interested and this looks pretty solid to me 👀
tianon
reviewed
Feb 10, 2023
265ea8e to
e3deb69
Compare
OCI added support for a `data` field in a descriptor. This field is expected to contain the content being pointed to by the descriptor. Signed-off-by: Brian Goff <[email protected]>
e3deb69 to
13652e0
Compare
dmcgowan
approved these changes
Feb 10, 2023
fuweid
approved these changes
Feb 10, 2023
This was referenced Feb 25, 2023
This was referenced Mar 7, 2023
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.
OCI added support for a
datafield in a descriptor. This field is expected to contain the content being pointed to by the descriptor.As an example of this see: docker.io/tianon/true@sha256:434c266719c0dc4e936294efa36f66aed4f50a414ea495a234dce16454153478
{ "config": { "data": "ewoJImFyY2hpdGVjdHVyZSI6ICJhbWQ2NCIsCgkiY29uZmlnIjogewoJCSJDbWQiOiBbCgkJCSIvdHJ1ZSIKCQldCgl9LAoJImNyZWF0ZWQiOiAiMjAxNC0wMS0yNVQyMzoxMTowOVoiLAoJImhpc3RvcnkiOiBbCgkJewoJCQkiY3JlYXRlZCI6ICIyMDE0LTAxLTI1VDIzOjExOjA5WiIsCgkJCSJjcmVhdGVkX2J5IjogIm5hc20gLW8gL3RydWUgaHR0cHM6Ly9naXRodWIuY29tL3RpYW5vbi9kb2NrZXJmaWxlcy9ibG9iLzRhMWRkMjM0ZmEyZTY3MWM5MjljMDk5Mjk3MDliZjMzYWZmZGM1OTcvdHJ1ZS90cnVlLmFzbSIKCQl9CgldLAoJIm9zIjogImxpbnV4IiwKCSJyb290ZnMiOiB7CgkJImRpZmZfaWRzIjogWwoJCQkic2hhMjU2OjBmZjNiOTFiZGYyMWVjZGYyZjJmM2Q0MzcyYzIwOThhMTRkYmUwNmNkNjc4ZThmMGE4NWZkNDkwMmQwMGUyZTIiCgkJXSwKCQkidHlwZSI6ICJsYXllcnMiCgl9Cn0K", "digest": "sha256:a181593bfa4535abc8b6ee849bb4d7ba67ac80487285b29ff30f5f1f4040ff24", "mediaType": "application/vnd.oci.image.config.v1+json", "size": 453 }, "layers": [ { "data": "H4sIAAAAAAAA/yopKk1loDEwMDQwMDc3ZTCAAHTawNDchMHQxNjMzMTI2MDECKTe0MyIQcGA1g4DgdLiksQiBgOK7UL33BAB9a4+bkyMjHA+E4MdA4hXweAA5jtg0ePAYMEA0wGiWdFkkekaKK8GLq8AJjfY8LNS0RujYBSMglEwCkgEgAAAAP//MqdJrQAIAAA=", "digest": "sha256:46e21c7cfe177aec58c290f7a47589897415c5ce1f64acf4485ef267813f396c", "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip", "size": 146 } ], "mediaType": "application/vnd.oci.image.manifest.v1+json", "schemaVersion": 2 }With this change there is no need to fetch either the config or the layer because the data is already in the manifest.
ref: opencontainers/image-spec#826