[Train] podman image prune -a -f: option -f not recognized
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Invalid
|
Undecided
|
Unassigned |
Bug Description
It has been observed in some of the minor update jobs from Train the following failing task:
2020-10-01 10:27:27,042 p=46659 u=mistral n=ansible | TASK [Purge Podman] *******
2020-10-01 10:27:27,042 p=46659 u=mistral n=ansible | Thursday 01 October 2020 10:27:27 +0000 (0:00:00.275) 2:45:50.769 ******
2020-10-01 10:27:27,315 p=46659 u=mistral n=ansible | TASK [tripleo-podman : Clean podman images] *******
2020-10-01 10:27:27,316 p=46659 u=mistral n=ansible | Thursday 01 October 2020 10:27:27 +0000 (0:00:00.273) 2:45:51.043 ******
2020-10-01 10:27:27,686 p=46659 u=mistral n=ansible | fatal: [controller-2]: FAILED! => {"changed": true, "cmd": ["podman", "image", "prune", "-a", "-f"], "delta": "0:00:00.065628", "end": "2020-10-01 10:27:27.651327", "msg": "non-zero return code", "rc": 125, "start": "2020-10-01 10:27:27.585699", "stderr": "Error: unknown shorthand flag: 'f' in -f", "stderr_lines": ["Error: unknown shorthand flag: 'f' in -f"], "stdout": "", "stdout_lines": []}
[heat-admin@
podman-
podman-
Right DNF stream configured:
[heat-admin@
Updating Subscription Management repositories.
Unable to read consumer identity
/usr/lib/
instream = instream.decode()
This system is not registered to Red Hat Subscription Management. You can use subscription-
This system is not registered to Red Hat Subscription Management. You can use subscription-
Last metadata expiration check: 1:18:56 ago on Thu 01 Oct 2020 10:00:48 AM UTC.
rhel8 appstream
Name Stream Profiles Summary
389-ds 1.4 389 Directory Server (base)
ant 1.10 [d] common [d] Java build tool
container-tools rhel8 [d] common [d] Common tools and dependencies for container runtimes
container-tools 1.0 common [d] Common tools and dependencies for container runtimes
container-tools 2.0 [e] common [d] Common tools and dependencies for container runtimes
It looks like the -f flag was included in podman 2.0 so some logic should be added to catch if the -f flag needs to be added or not.
The task fails, but there is a rescue block which will run the command without -f if the flag isn't supported:
- name: Podman image prune /bugs.launchpad .net/tripleo/ +bug/1889418
become: true
block:
- name: Clean podman images
command: podman image prune -a -f
rescue:
# In case -f isn't available yet, we fallback to old way.
# https:/
- name: Clean podman images
command: podman image prune -a
https:/ /github. com/openstack/ tripleo- ansible/ commit/ f9b89173307bd6e 8495c757c098c3d da01f8c822
Close it as not a bug.