Description of problem: "oc adm prune images --prune-over-size-limit -n <namespace>"., is not working as expected. We have set the limit on the project as 1M and all the images in the registry are more than 1M, Still when we are trying to use --prune-over-size-limit option to delete the images, it not delete and giving below logs: ~~~ I0509 11:07:37.071872 73997 prune.go:893] imagestream openshift/tests: tag latest: revision 1: keeping sha256:d19869b0107d9c6a3c88a274441de92d148de33576ee5f015547e57e2ec88ba4 because of --keep-younger-than I0509 11:07:37.071886 73997 prune.go:893] imagestream openshift/tests: tag latest: revision 2: keeping sha256:0694873d36244589d44a4f522b1587a333ef33f93acb45866501cba4cdb94b02 because of --keep-younger-than I0509 11:07:37.071894 73997 prune.go:893] imagestream openshift/tests: tag latest: revision 3: keeping sha256:fcb99aa10e36fa1f706685899780238c0f4801ace8b14340ec1a0a7e0758624f because of --keep-younger-than Summary: deleted 0 objects ~~~ Looking at the code, this particular error message only comes up when pruning an imagestreamtag [0] which I believe is different from an image. [0] https://github.com/openshift/oc/blob/master/pkg/cli/admin/prune/imageprune/prune.go#L893 Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. oc adm prune images --prune-over-size-limit -n <namespace> 2. 3. Actual results: - In summary we see deleted object as 0 sha256:fcb99aa10e36fa1f706685899780238c0f4801ace8b14340ec1a0a7e0758624f because of --keep-younger-than Summary: deleted 0 objects Expected results: It should prune the images using --prune-over-size-limit Additional info:
Lowering severity as it doesn't cause data loss and it's not an upgrade blocker. Also it should be possible to workaround the problem by explicitly providing `--keep-younger-than=0s`.
could reproduced with older version : ./oc version --client Client Version: 4.8.38 ./oc adm prune images --prune-over-size-limit -v 8 > prune_output_old.txt 2>&1 [root@localhost ~]# cat prune_output_old.txt |grep "keep-younger-than" I0523 18:06:26.281328 36478 prune.go:894] imagestream openshift/installer-artifacts: tag latest: revision 1: keeping sha256:d30a1108c677ac241b143bc0375d3b6eafb8928e4ef0647efef14f1f15c3dd68 because of --keep-younger-than I0523 18:06:26.281419 36478 prune.go:894] imagestream openshift/fuse7-eap-openshift-java11: tag 1.10: revision 1: keeping sha256:4c7470a39df37f1f158e177dbba7f5aad2c00ce7c6b9be490a8275488fe1b9e1 because of --keep-younger-than ..... But can't reproduce with latest oc version : oc version --client Client Version: 4.11.0-0.nightly-2022-05-20-213928 Kustomize Version: v4.5.4 oc adm prune images --prune-over-size-limit -v 8 > prune_output.txt 2>&1 cat prune_output.txt |grep "keep-younger-than"
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:5069