Merge pull request #9142 from jsturtevant/no-changes-wasm
Allow for images with artifacts layers to pull and run
This commit is contained in:
commit
c33249cbe6
12
image.go
12
image.go
@ -379,7 +379,15 @@ func (i *image) getLayers(ctx context.Context, manifest ocispec.Manifest) ([]roo
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to resolve rootfs: %w", err)
|
||||
}
|
||||
if len(diffIDs) != len(manifest.Layers) {
|
||||
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
if len(diffIDs) != len(imageLayers) {
|
||||
return nil, errors.New("mismatched image rootfs and manifest layers")
|
||||
}
|
||||
layers := make([]rootfs.Layer, len(diffIDs))
|
||||
@ -389,7 +397,7 @@ func (i *image) getLayers(ctx context.Context, manifest ocispec.Manifest) ([]roo
|
||||
MediaType: ocispec.MediaTypeImageLayer,
|
||||
Digest: diffIDs[i],
|
||||
}
|
||||
layers[i].Blob = manifest.Layers[i]
|
||||
layers[i].Blob = imageLayers[i]
|
||||
}
|
||||
return layers, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user