Comment 8 for bug 1862954

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to paunch (stable/stein)

Reviewed: https://review.opendev.org/711426
Committed: https://git.openstack.org/cgit/openstack/paunch/commit/?id=fab6bd7c18ab447f9b7beca75fb00398534e0359
Submitter: Zuul
Branch: stable/stein

commit fab6bd7c18ab447f9b7beca75fb00398534e0359
Author: Emilien Macchi <email address hidden>
Date: Wed Feb 12 10:21:38 2020 -0500

    Cleanup containers in the same loop as they are created

    Split delete_missing_and_updated() into 2 methods:

      * delete_missing(), that will remove all containers installed on the
        host but missing from the given config. This runs outside of the
        loop, once.
      * delete_updated(), that will remove a container installed on the host
        (if present), that is part of the config, if config_data changed or
        didn't exist. It runs within the create loop, so the downtime
        between a container removal and creation should be shorter than
        before.
      * make delete_missing(), delete_updated() and rename_containers()
        returning True, if any container has been touched by either. Use
        that flag in order to keep the container_names contents always
        actual.
      * in order to make that cached container_names working and saving off
        extra podman ps/inspect calls, rework it to return a list instead
        of an iterator. There is no huge lists of containers, iterators buy
        us nothing here, while podman CLI calls are the more expensive
        thing and we optimize the latter instead.

    (cherry picked from commit eb3d3b75bb8bf300fb52390610a6a53ddbfaa48e)
    Co-Authored-By: Bogdan Dobrelya <email address hidden>
    Change-Id: I3c6d0670e11d035287d12f4207489a13e0891943
    Closes-Bug: #1862954