Bug 1762837 - Image pruning fails if the image registry is removed
Summary: Image pruning fails if the image registry is removed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 4.1.z
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.4.0
Assignee: Ricardo Maraschini
QA Contact: Mike Fiedler
URL:
Whiteboard:
Depends On: 1790978
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-17 15:40 UTC by Adam Kaplan
Modified: 2020-05-04 11:15 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-04 11:14:34 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift oc pull 257 None closed Bug 1790978: Zeroing BearerTokenFile for prune. 2020-04-28 09:42:49 UTC
Github openshift oc pull 259 None closed Bug 1762837: Restrict pings to remote registry prior to prune. 2020-04-28 09:42:50 UTC
Red Hat Product Errata RHBA-2020:0581 None None None 2020-05-04 11:15:17 UTC

Description Adam Kaplan 2019-10-17 15:40:27 UTC
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`

Actual results:
Fails to run with error "unable to determine registry: ..."


Expected results:
Image pruner runs, even if registry is not installed on the cluster.


Additional info:
https://github.com/openshift/oc/blob/b6f4792b69cc6cb9d07f8ba88e73831c8a8fc470/pkg/cli/admin/prune/images/images.go#L430-L436

Comment 1 Adam Kaplan 2019-10-17 15:42:03 UTC
Blocks image pruning enhancement for 4.4 - https://github.com/openshift/enhancements/pull/49

Comment 3 Mike Fiedler 2020-01-31 19:58:35 UTC
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          

<snip>

Deleting image sha256:f56623d2766c4df4050324628ebe8afdce36ce709c9ec9d32b41f6dea0dd1c7f
Deleting image sha256:2544c64180aa7097d98e5b15d6f517526e8bbcaedf51ed8abbbb5318cbf397fd
Deleting image sha256:213b61598dda27836275b0202268eaf1bdbb808b46987b6400b55185a5fea62d
Deleting image sha256:c8df86340451404dfa4ecdd4e7019aaa742b63f1f6d2ab41c0bdc5f5a53263d6
Deleting image sha256:80c53990e909da38963c4f3f4bdbab94bb00d42826869868fc380dae68350d7d
Deleted 132 objects.

Comment 5 errata-xmlrpc 2020-05-04 11:14:34 UTC
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.

https://access.redhat.com/errata/RHBA-2020:0581


Note You need to log in before you can comment on or make changes to this bug.