File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -379,7 +379,15 @@ func (i *image) getLayers(ctx context.Context, manifest ocispec.Manifest) ([]roo
379
379
if err != nil {
380
380
return nil , fmt .Errorf ("failed to resolve rootfs: %w" , err )
381
381
}
382
- if len (diffIDs ) != len (manifest .Layers ) {
382
+
383
+ // parse out the image layers from oci artifact layers
384
+ imageLayers := []ocispec.Descriptor {}
385
+ for _ , ociLayer := range manifest .Layers {
386
+ if images .IsLayerType (ociLayer .MediaType ) {
387
+ imageLayers = append (imageLayers , ociLayer )
388
+ }
389
+ }
390
+ if len (diffIDs ) != len (imageLayers ) {
383
391
return nil , errors .New ("mismatched image rootfs and manifest layers" )
384
392
}
385
393
layers := make ([]rootfs.Layer , len (diffIDs ))
@@ -389,7 +397,7 @@ func (i *image) getLayers(ctx context.Context, manifest ocispec.Manifest) ([]roo
389
397
MediaType : ocispec .MediaTypeImageLayer ,
390
398
Digest : diffIDs [i ],
391
399
}
392
- layers [i ].Blob = manifest . Layers [i ]
400
+ layers [i ].Blob = imageLayers [i ]
393
401
}
394
402
return layers , nil
395
403
}
You can’t perform that action at this time.
0 commit comments