This repository was archived by the owner on Nov 19, 2026. It is now read-only.
Repository navigation
image: fix docker v2s2 -> oci image config conversion - #232
Merged
Merged
Conversation
mtrmac
reviewed
Jan 31, 2017
mtrmac
left a comment
Collaborator
There was a problem hiding this comment.
Broadly LGTM, just a few nits.
Also please consider adding a comment explaining why we can assume gzip, per #229 (comment) etc.
| if err != nil { | ||
| return nil, err | ||
| } | ||
| configOCI := &imgspecv1.Image{} |
Collaborator
There was a problem hiding this comment.
It’s non-obvious what this does. This would benefit from a comment, saying something like “The two versions of config are mostly compatible, but v2s2 has an extra $name field; this unmarshal+re-marshal effectively drops it.”
| @@ -197,7 +208,7 @@ func (m *manifestSchema2) convertToManifestOCI1() (types.Image, error) { | |||
| // Rather than copying the ConfigBlob now, we just pass m.src to the | |||
| // translated manifest, since the only difference is the mediatype of | |||
| // descriptors there is no change to any blob stored in m.src. | |||
Collaborator
There was a problem hiding this comment.
This comment is no longer true. (Passing m.src is fine, just don’t say that we are not copying the ConfigBlob.)
| config := descriptor{} | ||
| config.MediaType = imgspecv1.MediaTypeImageConfig | ||
| config.Size = int64(len(configOCIBytes)) | ||
| config.Digest = digest.FromBytes(configOCIBytes) |
Collaborator
There was a problem hiding this comment.
Use a single struct initializer,
config := descriptor{
MediaType: …,
Size: …,
…
}?
runcom
force-pushed
the
fix-oci-image-config
branch
from
January 31, 2017 16:40
601f979 to
5987a03
Compare
Member
Author
|
@mtrmac PTAL |
Collaborator
Member
Author
Member
Author
|
Wait, I forgot to add a comment on why we assume gzip, fixing it |
Signed-off-by: Antonio Murdaca <[email protected]>
runcom
force-pushed
the
fix-oci-image-config
branch
from
January 31, 2017 16:59
5987a03 to
0db77be
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fix #229
@mtrmac PTAL
Signed-off-by: Antonio Murdaca [email protected]