Bug 1467340

Summary: [Registry][Pruning] Orphaned blobs cannot be pruned
Product: OpenShift Container Platform Reporter: Michal Minar <miminar>
Component: Image RegistryAssignee: Michal Minar <miminar>
Status: CLOSED DUPLICATE QA Contact: ge liu <geliu>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.6.1CC: aos-bugs, bleanhar, dcaldwel, dmoessne, erich, geliu, jkaur, mfojtik, miminar, misalunk, pdwyer, xtian, yinzhou
Target Milestone: ---Keywords: Reopened
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1408676
: 1471844 1472438 (view as bug list) Environment:
Last Closed: 2017-08-23 14:32:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1408676, 1499314, 1499315    
Bug Blocks: 1471844, 1472438    

Comment 3 ge liu 2017-07-04 06:36:22 UTC
Verified this bug with fork ami:

Version: 
openshift v1.5.0-alpha.2+c85f23e-2428
kubernetes v1.6.1+5115d708d7
etcd 3.1.0

1. add system:image-pruner role to user:
 oadm policy add-cluster-role-to-user system:image-pruner geliu

2. Run `oc adm prune images` in a loop 
 # while true; do oc adm prune images --keep-younger-than=0s --confirm; done

3. Open another terminate window and oc new-project lgp1
4. oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git
5. oc scale dc ruby-ex --replicas=0
6. Wait for build to complete

7. back to first terminate window to check the step 2, there is not any images blob be deleted

8. # docker pull 172.30.21.234:5000/lgp1/ruby-ex:latest successfully
9. oc delete project lgp1

10. back to first terminate window to check the step 2, there are blob data be deleted

# while true; do oc adm prune images --keep-younger-than=0s --confirm; done
 
Deleting registry layer blobs ...
BLOB
sha256:3254209b5b32595a24fdfe44bd52b373979cc5641e4cf3d56b51811e5a6895e0
.....................

Comment 11 Brenton Leanhardt 2017-08-23 14:32:53 UTC

*** This bug has been marked as a duplicate of bug 1479340 ***

Comment 12 Brenton Leanhardt 2017-08-23 14:36:52 UTC
Just fyi, the reason this bug targeting 3.7 was labeled a duplicate is simply because the code is already upstream in Origin which is where 3.7 is being developed.

Comment 13 Red Hat Bugzilla 2023-09-15 00:02:54 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days