[Train] podman image prune -a -f: option -f not recognized

Bug #1898030 reported by Jose Luis Franco
6
This bug affects 1 person
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@controller-0 ~]$ sudo rpm -qa | grep podman
podman-docker-1.6.4-16.module+el8.2.0+7659+b700d80e.noarch
podman-1.6.4-16.module+el8.2.0+7659+b700d80e.x86_64

Right DNF stream configured:

[heat-admin@controller-0 ~]$ sudo dnf module list
Updating Subscription Management repositories.
Unable to read consumer identity
/usr/lib/python3.6/site-packages/dateutil/parser/_parser.py:70: UnicodeWarning: decode() called on unicode string, see https://bugzilla.redhat.com/show_bug.cgi?id=1693751
  instream = instream.decode()

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
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.

Revision history for this message
Jose Luis Franco (jfrancoa) wrote :

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
  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://bugs.launchpad.net/tripleo/+bug/1889418
    - name: Clean podman images
      command: podman image prune -a

https://github.com/openstack/tripleo-ansible/commit/f9b89173307bd6e8495c757c098c3dda01f8c822

Close it as not a bug.

Changed in tripleo:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.