Fixes#712
Podman 5 changed the output of `podman pod info` (when run on a
single pod) from being a dict to being a list of dicts:
https://github.com/containers/podman/pull/21514
this should handle both ways. Unfortunately not sure how to add
a test for this as I can't see a unit test that mocks the output
of the command, only the integration test that gets real live
output, and I'm not sure how to get that test run with Podman 5.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
* Update env_file to accept a list of files instead of a single file
Signed-off-by: antoine <antoine.blin@gandi.net>
* Update doc: add alias env_files
Signed-off-by: antoine <antoine.blin@gandi.net>
* Update plugins/module_utils/podman/podman_container_lib.py
Use real arg name and not alias
Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>
---------
Signed-off-by: antoine <antoine.blin@gandi.net>
Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>
We have a few calculations of given options and arguments from
CreateCommand, so let's do it in a more convinient way.
Define a function _createcommand which receives an argument
and returns all values for it in a command line of Podman.
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
* Alias generate systemd options `stop_timeout` and `time`
Closes#683
Option `time` was used before Podman v4, then it was renamed
`stop_timeout`.
Accept both names (the newer takes prirority) and set the correct
CLI argument name based on the detected Podman version.
Signed-off-by: Alessandro Fulgini <fuljo97@gmail.com>
* Fix typo in parameter name `--stop-timeout`
Signed-off-by: Alessandro Fulgini <fuljo97@gmail.com>
* Don't delete temporary variables at the end of block
Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>
---------
Signed-off-by: Alessandro Fulgini <fuljo97@gmail.com>
Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>
Fix#675
If we explicitly set to generate systemd with parameters, fail
the module if the generation failed.
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
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>