Bug 1766110

Summary: [4.1.z] Cannot prune registry 'invalid resource name "psd2-anusha/psd2-anusha": [may not contain '/']'
Product: OpenShift Container Platform Reporter: Ricardo Maraschini <rmarasch>
Component: Image RegistryAssignee: Ricardo Maraschini <rmarasch>
Status: CLOSED ERRATA QA Contact: Wenjing Zheng <wzheng>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.9.0CC: adam.kaplan, aos-bugs, obulatov, rmarasch, sgarciam, wzheng
Target Milestone: ---   
Target Release: 4.1.z   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: older imagestreams could have an invalid name Consequence: image pruning failed because the specs for the imagestream's tags were not valid Fix: image pruner will always prune images if the associated imagestream has an invalid name Result: image pruning completes if imagestreams with invalid names are present
Story Points: ---
Clone Of: 1755780 Environment:
Last Closed: 2019-11-12 12:51:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1749256, 1755780, 1766113    
Bug Blocks: 1752513    

Comment 2 Wenjing Zheng 2019-11-06 10:15:48 UTC
Verified as below:
[wzheng@laptop 4.1]$ oc adm policy add-cluster-role-to-user system:image-pruner system:serviceaccount:openshift-image-registry:registry
clusterrole.rbac.authorization.k8s.io/system:image-pruner added: "system:serviceaccount:openshift-image-registry:registry"
[wzheng@laptop 4.1]$ oc exec image-registry-69559dcbf-znxk9 -- /bin/sh -c 'REGISTRY_LOG_LEVEL=info /usr/bin/dockerregistry -prune=check'
time="2019-11-06T10:14:50.371580922Z" level=info msg="start prune (dry-run mode)" distribution_version=v2.6.0+unknown go.version=go1.10.8 openshift_version=v4.1.23-201911050122+46aafb1-dirty
time="2019-11-06T10:14:50.80312252Z" level=info msg="The image stream openshift/ose-ansible-service-broker-operator is not found, will remove the whole repository" go.version=go1.10.8
time="2019-11-06T10:14:51.068764112Z" level=info msg="Invalid image name wzheng3/foo/ruby-ex, removing whole repository" go.version=go1.10.8
time="2019-11-06T10:14:51.068802923Z" level=info msg="Would delete repository: openshift/ose-ansible-service-broker-operator" go.version=go1.10.8
time="2019-11-06T10:14:51.169610414Z" level=info msg="Would delete repository: wzheng3/foo/ruby-ex" go.version=go1.10.8
time="2019-11-06T10:14:51.356342341Z" level=info msg="Would delete blob: sha256:5b1d8a575bd78b318457903c54b6ebfcd5b3079e1d3998a224b2abea72347b6a" go.version=go1.10.8
time="2019-11-06T10:14:51.525745537Z" level=info msg="Would delete blob: sha256:ac70db69091e7f1f731b2d3513be39f30b69629f4afd49db4347fc56e8ae30fd" go.version=go1.10.8
time="2019-11-06T10:14:51.643646152Z" level=info msg="Would delete blob: sha256:ee75b91b1e7ceab2901fbb9559e302fd961b26e68d63bae0d6f666801b62afbf" go.version=go1.10.8
Would delete 3 blobs
Would free up 3.374MiB of disk space
Use -prune=delete to actually delete the data
[wzheng@laptop 4.1]$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.1.0-0.nightly-2019-11-05-091918   True        False         99m     Cluster version is 4.1.0-0.nightly-2019-11-05-091918

Comment 4 errata-xmlrpc 2019-11-12 12:51:51 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.