Is it possible to skip images during openshift adm image prune

Viewed 81

I am trying to cleanup the images pushed to the openshift integrated image registry. Following openshift documentation, i am using below command

oc adm prune images --registry-url=<url> --keep-tag-revisions=1 --keep-younger-than=1s

There are multiple options like size, time and number of tags. Is it possible to skip some images from pruning.

1 Answers

In order to skip some images from being pruned, you can use these options:

--all=false: To limit the pruning to images that were pushed to the integrated registry, pass --all=false. This will prevent the images that were not pushed to the registry, but have been mirrored by pullthrough, from being pruned.

--keep-tag-revisions=: For each imagestream, keep up to at most N image revisions per tag (default 3).

--keep-younger-than=: Do not prune any image that is younger than relative to the current time. Alternately, do not prune any image that is referenced by any other object that is younger than relative to the current time (default 60m).

--prune-over-size-limit: Prune each image that exceeds the smallest limit defined in the same project. This flag cannot be combined with --keep-tag-revisions nor --keep-younger-than.

This is as per OCP 4.10. Reference

Related