-
Notifications
You must be signed in to change notification settings - Fork 602
Closed
Description
#261 added support for OCI Image Layout, but only supports Image Layers of two media types:
- application/vnd.oci.image.layer.v1.tar+gzip
- application/vnd.docker.image.rootfs.diff.tar.gzip
For any other value of media type it returns an error (see the TODO's):
go-containerregistry/pkg/v1/layout/image.go
Lines 96 to 106 in 34b7f00
| switch desc.MediaType { | |
| case types.OCILayer, types.DockerLayer: | |
| return &compressedBlob{ | |
| path: li.path, | |
| desc: desc, | |
| }, nil | |
| default: | |
| // TODO: We assume everything is a compressed blob, but that might not be true. | |
| // TODO: Handle foreign layers. | |
| return nil, fmt.Errorf("unexpected media type: %v for layer: %v", desc.MediaType, desc.Digest) | |
| } |
Issue 1. Supporting non-compressed layers
The OCI Image Manifest specification requires support for at least 4 types, including 2 non-compressed layer types (.tar):
- application/vnd.oci.image.layer.v1.tar
- application/vnd.oci.image.layer.v1.tar+gzip
- application/vnd.oci.image.layer.nondistributable.v1.tar
- application/vnd.oci.image.layer.nondistributable.v1.tar+gzip
Issue 2. Supporting foreign {compressed, non-compressed} layers
The OCI Artifacts project defines additional media types like Helm Charts and custom media types. Examples include:
- application/vnd.cncf.helm.chart.layer.v1.tar+gzip
- application/tar+gzip
- etc.
Possible work-arounds
- Allow any media type: I verified removing the explicit check for
types.OCILayer, types.DockerLayerallows us to push layers of arbitrary media types, but wasn't sure how this might conflict withcompressedBlob. - Allow any media type ending in
+gzip: (Image Manifest specification mentions "Entries in this field will frequently use the+gziptypes.") - Something else?
Happy to open a PR to support this, but wanted to check how we might want to handle it.
Metadata
Metadata
Assignees
Labels
No labels