Skip to content

Commit

Permalink
Don't remove pinned images on image prune
Browse files Browse the repository at this point in the history
Signed-off-by: David Son <[email protected]>
  • Loading branch information
sondavidb committed Feb 22, 2024
1 parent 7c196c0 commit b25828e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/crictl/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,11 @@ var removeImageCommand = &cli.Command{
return err
}
for _, img := range r {
logrus.Debugf("Adding image to be removed: %v", img.GetId())
ids[img.GetId()] = true
// Pinned images should not be removed on prune.
if all || (prune && !img.Pinned) {
logrus.Debugf("Adding image to be removed: %v", img.GetId())
ids[img.GetId()] = true
}
}
}

Expand Down

0 comments on commit b25828e

Please sign in to comment.