Description of problem:
Image pruning fails if the image registry is removed.
There are cases where the image pruner should be run even if the image registry is removed from the cluster
Version-Release number of selected component (if applicable): 4.1.z
How reproducible: Always
Steps to Reproduce:
1. Update the image registry operator's management state to `Removed`
2. Run the image pruner - `oc adm prune images -prune-registry=false`
Fails to run with error "unable to determine registry: ..."
Image pruner runs, even if registry is not installed on the cluster.
Blocks image pruning enhancement for 4.4 - https://github.com/openshift/enhancements/pull/49
Verified on 4.4.0-0.nightly-2020-01-31-115654. Image pruner still runs when registry managedState is set to Removed:
# oc adm prune images --prune-registry=false
Dry run enabled - no modifications will be made. Add --confirm to remove images
Only API objects will be removed. No modifications to the image registry will be made.
Updating istags svt-99/cakephp-mysql-example: latest
Updating istags svt-57/cakephp-mysql-example: latest
Updating istags svt-34/cakephp-mysql-example: latest
Updating istags svt-83/cakephp-mysql-example: latest
Updating istags svt-60/cakephp-mysql-example: latest
Deleting image sha256:f56623d2766c4df4050324628ebe8afdce36ce709c9ec9d32b41f6dea0dd1c7f
Deleting image sha256:2544c64180aa7097d98e5b15d6f517526e8bbcaedf51ed8abbbb5318cbf397fd
Deleting image sha256:213b61598dda27836275b0202268eaf1bdbb808b46987b6400b55185a5fea62d
Deleting image sha256:c8df86340451404dfa4ecdd4e7019aaa742b63f1f6d2ab41c0bdc5f5a53263d6
Deleting image sha256:80c53990e909da38963c4f3f4bdbab94bb00d42826869868fc380dae68350d7d
Deleted 132 objects.
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, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.