If `recreate` flag is enabled we should be able to (force) recreate stopped
containers even if they're configuration isn't changed.
Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
Since SElinux labels are basically annotations, they are merged in a single comma separated string in the list by podman, so we need to split them in a sorted list if we want to compare it to the list that we provide to the module.
Also, a proper test of this example has been added.
Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
This reverts commit cb832c9a84.
We lose flexibility in recreating workflow, replace actually
does the same in Podman - stops and removes/creates.
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
Previously, this would only mark the userns as expected when `uidmap`
or `gidmap` is passed. However, in the case `userns` is passed, this
is also expected to be set.
Signed-off-by: Benjamin Schubert <contact@benschubert.me>
* fix pod running status for older podman versions
Older podman versions, such as podman 1.6.4 on CentOS 7, do not have the
pod status in the 'podman pod inspect' output. Added an attribute and a
method to PodmanPod to fetch the 'podman pod ps' output. Added an
additional status check to the exising running property that uses the
'ps' info.
Fixes#499
Signed-off-by: antonc42 <antonc42@users.noreply.github.com>
* Check image with os path if rootfs is used
Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>
* Take into account rootfs usage while evaluating a diff
Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>
* Always compare rootfs image diffparam as strict
Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>
* Reverse image labels getter to ignore the value if None
Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>
* Add tests to check podman rootfs containers
Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>
Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>
* Fix restarting containers if --rm is enabled
* Automatically enable rm if generate_systemd.new is set
* Don't assume that the 'new' key in generate_systemd exists
Signed-off-by: Adrian Freund <adrian@freund.io>
podman 4.1.x has changed the ipc namespace mode default to
shareable[1] that results in containers being restarted.
[1] 3987c529f4
Resolves: rhbz#2101495
Signed-off-by: Rabi Mishra <ramishra@redhat.com>
Because of complexity in Podman logic and calculations of b/m/g
etc let's disable this idempotency for now.
Fix#418
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
* Change network attribute from str to list in pods
Signed-off-by: André Cirne <dumahk21@gmail.com>
* Fix tests
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
Co-authored-by: André Cirne <dumahk21@gmail.com>
Since Podman changes its defaults very often and it's impossible
to track and identify every time what is current log level, let's
remove idempotency for this parameter for now.
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
The --read-only option is not checked for changes between runs of
ansible thus the container is not recreated if the user changes
the root image between read-write to read-only.
Default for the read_only variable set to False in line with
documentation and so that later checks are simplified.
This is a fix for bug #383.
Signed-off-by: Andrew <rubiksdot@grue.cc>
Co-authored-by: Andrew <rubiksdot@grue.cc>