-
Notifications
You must be signed in to change notification settings - Fork 395
[WIP] *: support layers federation #147
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,12 @@ func (d *ociImageDestination) ShouldCompressLayers() bool { | |
| return false | ||
| } | ||
|
|
||
| // AcceptsForeignLayerURLs returns false iff foreign layers in manifest should be actually | ||
| // uploaded to the image destination, true otherwise. | ||
| func (d *ociImageDestination) AcceptsForeignLayerURLs() bool { | ||
| return false | ||
| } | ||
|
|
||
| // PutBlob writes contents of stream and returns data representing the result (with all data filled in). | ||
| // inputInfo.Digest can be optionally provided if known; it is not mandatory for the implementation to verify it. | ||
| // inputInfo.Size is the expected length of stream, if known. | ||
|
|
@@ -121,8 +127,12 @@ func createManifest(m []byte) ([]byte, string, error) { | |
| return nil, "", err | ||
| } | ||
| om.MediaType = imgspecv1.MediaTypeImageManifest | ||
| for i := range om.Layers { | ||
| om.Layers[i].MediaType = imgspecv1.MediaTypeImageLayer | ||
| for i, l := range om.Layers { | ||
| if l.MediaType == manifest.DockerV2Schema2ForeignLayerMediaType { | ||
| om.Layers[i].MediaType = imgspecv1.MediaTypeImageLayerNonDistributable | ||
| } else { | ||
| om.Layers[i].MediaType = imgspecv1.MediaTypeImageLayer | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remember correctly the OCI discussion of URLs vs. MIME types, Or is the semantics of URLs vs. MIME type different between Docker s2 and OCI? |
||
| } | ||
| } | ||
| om.Config.MediaType = imgspecv1.MediaTypeImageConfig | ||
| b, err := json.Marshal(om) | ||
|
|
||
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.
Why is this
truefordir:butfalseforoci:? At a first glance it seems that the two should behave similarly.