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
15345ce4c3

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 fa68844b06)
This commit is contained in:
Michele Baldessari 2021-02-12 10:42:23 +01:00 committed by Alex Schultz
parent 2591ac559a
commit 68e5206abc
1 changed files with 3 additions and 1 deletions

View File

@ -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: