From 5547d1aa78eb2ce448cc2d898480478f567cebd5 Mon Sep 17 00:00:00 2001 From: Nikita Tokarchuk Date: Fri, 30 Aug 2024 00:01:02 +0200 Subject: [PATCH] Fix quadlet parameters when container uses rootfs Adjust quadlet parameters to set rootfs as image and clear image field when rootfs container is being used. Signed-off-by: Nikita Tokarchuk --- plugins/module_utils/podman/quadlet.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/module_utils/podman/quadlet.py b/plugins/module_utils/podman/quadlet.py index 83a95889..a04da3ee 100644 --- a/plugins/module_utils/podman/quadlet.py +++ b/plugins/module_utils/podman/quadlet.py @@ -166,6 +166,9 @@ def custom_prepare_params(self, params: dict) -> dict: params["label"] = ["%s=%s" % (k, v) for k, v in params["label"].items()] if params["env"]: params["env"] = ["%s=%s" % (k, v) for k, v in params["env"].items()] + if params["rootfs"]: + params["rootfs"] = params["image"] + params["image"] = None if params["sysctl"]: params["sysctl"] = ["%s=%s" % (k, v) for k, v in params["sysctl"].items()] if params["tmpfs"]: