|
@@ -224,6 +224,13 @@ func (is *store) Delete(id ID) ([]layer.Metadata, error) {
|
|
if imageMeta == nil {
|
|
if imageMeta == nil {
|
|
return nil, fmt.Errorf("unrecognized image ID %s", id.String())
|
|
return nil, fmt.Errorf("unrecognized image ID %s", id.String())
|
|
}
|
|
}
|
|
|
|
+ img, err := is.Get(id)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return nil, fmt.Errorf("unrecognized image %s, %v", id.String(), err)
|
|
|
|
+ }
|
|
|
|
+ if !system.IsOSSupported(img.OperatingSystem()) {
|
|
|
|
+ return nil, fmt.Errorf("unsupported image operating system %q", img.OperatingSystem())
|
|
|
|
+ }
|
|
for id := range imageMeta.children {
|
|
for id := range imageMeta.children {
|
|
is.fs.DeleteMetadata(id.Digest(), "parent")
|
|
is.fs.DeleteMetadata(id.Digest(), "parent")
|
|
}
|
|
}
|
|
@@ -238,7 +245,7 @@ func (is *store) Delete(id ID) ([]layer.Metadata, error) {
|
|
is.fs.Delete(id.Digest())
|
|
is.fs.Delete(id.Digest())
|
|
|
|
|
|
if imageMeta.layer != nil {
|
|
if imageMeta.layer != nil {
|
|
- return is.lss[imageMeta.layer.OS()].Release(imageMeta.layer)
|
|
|
|
|
|
+ return is.lss[img.OperatingSystem()].Release(imageMeta.layer)
|
|
}
|
|
}
|
|
return nil, nil
|
|
return nil, nil
|
|
}
|
|
}
|