Description of problem: The pruning command fails when a DeployConfig contains an empty string in the 'image:' field. For example: ---- [root@online-int-master-05114 ~]# oc get dc nodejs-mongo-persistent -n dakinitest20180313 -o yaml |grep image: image: ' ' ---- The error can be seen by running the image pruner. It's causing our pruning cron job to fail, which means there are images that are not getting cleaned up on a regular interval like they should. ---- [root@online-int-master-05114 ~]# oc adm prune images --keep-younger-than 12h --keep-tag-revisions 5 --token $TOKEN --confirm --loglevel 4 <snip> Failed to build graph! The following objects have invalid references: DeploymentConfig[dakinitest20180313/nodejs-mongo-persistent]: invalid docker image reference " ": invalid reference format Either fix the references or delete the objects to make the pruner proceed. ---- Version-Release number of selected component (if applicable): atomic-openshift-3.7.23-1.git.5.83efd71.el7.x86_64 How reproducible: Every time Steps to Reproduce: 1. Create an app using template nodejs-mongo-persistent (I think any other type of app would work too, as long as there's a DeployConfig). 2. Check the 'image:' line inside the DeployConfig. Make sure it's blank (image: ' '). 3. Run the pruner: oc adm prune images --keep-younger-than 12h --keep-tag-revisions 5 --token $TOKEN --confirm --loglevel 4 Actual results: Pruning fails due to the 'image' field being blank. Expected results: Ideally pruning would skip the invalid DC's and move onto the other ones, so we can still benefit from cleaning up the rest of the images. Additional info:
*** This bug has been marked as a duplicate of bug 1518817 ***
This isn't exactly a dupe of 1518817. we need to tolerate the empty string image field values because it's a common pattern. But I believe Alexey already implemented a fix for this, perhaps it was not backported to 3.7 though?
Yes, it is not backported.
Stephanie do you guys need this backported or can you make do until 3.9?
3.9 is fine, thanks.
Verified openshift v3.7.44 kubernetes v1.7.6+a08f5eeb62 etcd 3.2.8 cannot set blank in dc 'image' field now. # oc create -f dc.yml -n dyan The DeploymentConfig "nodejs-mongodb-example" is invalid: spec.template.spec.containers[0].image: Required value it will fill value automatic if dc includes imageChange trigger parameters, or it will prompt error So cannot reproduce this error when prune images
Hi, Ben, Alexey What do you think about cannot set blank in dc 'image' field
the value needs to be a single space, not empty: image: " "
Thanks Ben, verify again openshift v3.7.46 kubernetes v1.7.6+a08f5eeb62 etcd 3.2.8 Reproduce steps: 1. Edit dc, set single space as the value in 'image' field, delete imageChange trigger parameters 2.Prune images # oc adm prune images --keep-younger-than 0 --keep-tag-revisions 0 --token pmOg3zqQL8BvEetZREYEbXVJb1WrMlKAwbS7HSZbC-I --confirm --loglevel 4 Actual results: could prune images without error
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:1576