Bug 1577356

Summary: [3.7] oadm prune images fails on invalid image reference
Product: OpenShift Container Platform Reporter: Ben Parees <bparees>
Component: Image RegistryAssignee: Alexey Gladkov <agladkov>
Status: CLOSED ERRATA QA Contact: Dongbo Yan <dyan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.7.0CC: agladkov, aos-bugs, bduffy, bmorriso, bparees, cdaley, dakini, dyan, fshaikh, ihorvath, jokerman, jupierce, maszulik, mmccomas, nraghava, tnozicka, vwalek
Target Milestone: ---Keywords: OpsBlocker
Target Release: 3.7.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1518817 Environment:
Last Closed: 2018-06-07 08:40:56 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: 1518817    
Bug Blocks:    

Comment 7 Dongbo Yan 2018-05-28 11:08:20 UTC
Verified
openshift v3.7.51
kubernetes v1.7.6+a08f5eeb62
etcd 3.2.8

Reproduce steps:
1. Edit dc with invalid image reference in 'image' field like below:
        image: docker-registry.default.svc:5000/dyan/cakephp-mysql-example@sha256:latest

2. Prune images
 $ oc adm prune images --keep-tag-revisions=0 --keep-younger-than=0 --token=jf9HRi58RqN0GqBerRyn9UHXHxAvQImhlr6tJ5RhDYE --confirm --loglevel=4

Failed to build graph!

The following objects have invalid references:

  Pod[dyan/cakephp-mysql-example-6-hook-pre]: invalid docker image reference "docker-registry.default.svc:5000/dyan/cakephp-mysql-example@sha256:latest": invalid reference format
  ReplicationController[dyan/cakephp-mysql-example-6]: invalid docker image reference "docker-registry.default.svc:5000/dyan/cakephp-mysql-example@sha256:latest": invalid reference format
  DeploymentConfig[dyan/cakephp-mysql-example]: invalid docker image reference "docker-registry.default.svc:5000/dyan/cakephp-mysql-example@sha256:latest": invalid reference format

Either fix the references or delete the objects to make the pruner proceed.
F0516 03:40:11.697121    1269 helpers.go:119] error: failed to build graph - no changes made

3. Prune images with option '--ignore-invalid-refs'
could prune images without errors

Comment 9 errata-xmlrpc 2018-06-07 08:40:56 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:1798