Skip to content

Commit

Permalink
fix: when using docker cr, ignore deletion used image by running cont…
Browse files Browse the repository at this point in the history
…ainer

Signed-off-by: Zhou Zhiqiang <[email protected]>
  • Loading branch information
STRRL committed Dec 15, 2023
1 parent 15d4ff7 commit 88286ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/minikube/machine/cache_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ func removeExistingImage(r cruntime.Manager, src string, imgName string) error {
}

errStr := strings.ToLower(err.Error())
if strings.Contains(errStr, "is using its referenced image") {
klog.Warningf("Image %s is being used by a running container, skipping deletion, it would be replaced later", imgName)
return nil
}

if !strings.Contains(errStr, "no such image") {
return errors.Wrap(err, "removing image")
}
Expand Down

0 comments on commit 88286ff

Please sign in to comment.