Skip to content

Commit

Permalink
fix: allow non-OCI layers
Browse files Browse the repository at this point in the history
opencontainers/image-spec#1190
https://www.cyphar.com/blog/post/20190121-ociv2-images-i-tar

As part of improving handling large images and also broadly considering
building layers as full mountable filesystems, relax the layer type
check.

This allows containerd clients to pull and produce rootfs simply by
mounting them.

Signed-off-by: Ramkumar Chinchani <[email protected]>
  • Loading branch information
rchincha committed Dec 14, 2024
1 parent 2207955 commit 4c64c74
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions client/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,7 @@ func (i *image) getLayers(ctx context.Context, manifest ocispec.Manifest) ([]roo
// parse out the image layers from oci artifact layers
imageLayers := []ocispec.Descriptor{}
for _, ociLayer := range manifest.Layers {
if images.IsLayerType(ociLayer.MediaType) {
imageLayers = append(imageLayers, ociLayer)
}
imageLayers = append(imageLayers, ociLayer)
}
if len(diffIDs) != len(imageLayers) {
return nil, errors.New("mismatched image rootfs and manifest layers")
Expand Down

0 comments on commit 4c64c74

Please sign in to comment.