Skip to content

Commit

Permalink
Merge pull request #1360 from sondavidb/dont-remove-pinned-images-on-…
Browse files Browse the repository at this point in the history
…prune

Don't remove pinned images on image prune
  • Loading branch information
k8s-ci-robot authored Feb 26, 2024
2 parents b9a928b + af4707c commit f638383
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/crictl/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,12 @@ var removeImageCommand = &cli.Command{
return err
}
for _, img := range r {
logrus.Debugf("Adding image to be removed: %v", img.GetId())
// Pinned images should not be removed on prune.
if prune && img.Pinned {
logrus.Debugf("Excluding pinned container image: %v", img.GetId())
continue
}
logrus.Debugf("Adding container image to be removed: %v", img.GetId())
ids[img.GetId()] = true
}
}
Expand Down

0 comments on commit f638383

Please sign in to comment.