mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #75367 from feiskyer/fix-dockershim-panic
Fix panic when removing docker images
This commit is contained in:
commit
0f6196878d
@ -127,6 +127,11 @@ func (ds *dockerService) RemoveImage(_ context.Context, r *runtimeapi.RemoveImag
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if imageInspect == nil {
|
||||||
|
// image is nil, assuming it doesn't exist.
|
||||||
|
return &runtimeapi.RemoveImageResponse{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
// An image can have different numbers of RepoTags and RepoDigests.
|
// An image can have different numbers of RepoTags and RepoDigests.
|
||||||
// Iterating over both of them plus the image ID ensures the image really got removed.
|
// Iterating over both of them plus the image ID ensures the image really got removed.
|
||||||
// It also prevents images from being deleted, which actually are deletable using this approach.
|
// It also prevents images from being deleted, which actually are deletable using this approach.
|
||||||
|
Loading…
Reference in New Issue
Block a user