Bug 1509362

Summary: [3.4] Prune Deleted Layer of a Valid Image due to minimum aging
Product: OpenShift Container Platform Reporter: Ben Parees <bparees>
Component: Image RegistryAssignee: Michal Minar <miminar>
Status: CLOSED ERRATA QA Contact: Dongbo Yan <dyan>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.4.1CC: aos-bugs, bparees, dyan, erich, geliu, haowang, jokerman, mfojtik, miminar, mmccomas, mrobson, obulatov, pdwyer, qcai, rhowe, sreber
Target Milestone: ---   
Target Release: 3.4.z   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: images younger than the threshold are not added to the dependency graph. Consequence: a blob which is used by a young image and by a prunable image is deleted because it has no references in the graph. Fix: add young images to the graph and mark them as non-prunable. Result: the blob has references and is not deleted.
Story Points: ---
Clone Of: 1487408 Environment:
Last Closed: 2018-04-18 07:00:36 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: 1487408    
Bug Blocks: 1498123, 1498124    

Comment 1 Michal Minar 2017-11-06 15:50:41 UTC
PR: https://github.com/openshift/ose/pull/924

Comment 2 Michal Minar 2017-11-06 18:14:02 UTC
Merged.

Comment 3 Dongbo Yan 2017-11-10 06:38:01 UTC
Verified
$ ./oc version
oc v3.4.1.44.37
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://8443
openshift v3.4.1.44.37
kubernetes v1.4.0+776c994

push two images reference the same image layer, one is pushed more 10min. Prune the old image via cmd
$ ./oc adm prune images --certificate-authority=ca.crt --keep-younger-than=30m --registry-url=docker-registry-default.com --confirm

Deleting registry layer blobs ...
BLOB
sha256:aea8745b76ae0c80e3ce9474a49cb33194ed5aaadb0228eb8eb468bed9fbb871

Deleting images from server ...
IMAGE
sha256:6b022de1e813246e316de3abbd9e9562908eaa42f7dffce7e74a85e53024cde4

Actual result:the new image is not pruned

could move to verified

Comment 6 errata-xmlrpc 2018-04-18 07:00:36 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-2018:1134