From 68e5206abcd76aff4f2ffbf3c37eae3a60136803 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 12 Feb 2021 10:42:23 +0100 Subject: [PATCH] Do not call --detach when using podman create We should never use --detached when calling podman create as it makes no sense and has actually been removed in podman 3 via https://github.com/containers/podman/commit/15345ce4c3b02389fe172f090549a50b95322753 Any use of that flag when using podman >= 3.x create will error out with: Error: unknown flag: --detach Change-Id: I8356110aba03dcbc09de97633bfe6f03580e2e7a Closes-Bug: #1915500 (cherry picked from commit fa68844b069090f73364988c967d4ad018348c99) --- paunch/builder/podman.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paunch/builder/podman.py b/paunch/builder/podman.py index 43add52..3186afe 100644 --- a/paunch/builder/podman.py +++ b/paunch/builder/podman.py @@ -43,7 +43,9 @@ class PodmanBuilder(base.BaseBuilder): # via systemd cmd.append('--conmon-pidfile=/var/run/{}.pid'.format(delegate)) - if cconfig.get('detach', True): + # (bandini) - We must never use --detach when we call podman create as + # it makes no sense whatsoever and podman-3.x errors out on it + if 'create' not in cmd and cconfig.get('detach', True): cmd.append('--detach=true') if self.cont_log_path is not None: