summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-09-09 13:31:25 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-09-09 14:04:50 +0200
commit9b8aaf88e70be9d51c11bce43c24c5d765dd2973 (patch)
tree268d1017754790a389f3f454c01a99abb3f42839 /pkg/systemd/generate
parent6b1a1fcc5cb92a9fd5800b0d1af44f26093a8153 (diff)
downloadpodman-9b8aaf88e70be9d51c11bce43c24c5d765dd2973.tar.gz
podman-9b8aaf88e70be9d51c11bce43c24c5d765dd2973.tar.bz2
podman-9b8aaf88e70be9d51c11bce43c24c5d765dd2973.zip
generate systemd: catch `--name=foo`
The systemd generator looks for certain flags in the containers' create commands to determine which flags need to be added. In case of named containers, the generator adds the `--replace` flag to prevent name conflicts at container creation. Fix the generator to not only cover the `--name foo` syntax but also the `--name=foo` one. Fixes: #7157 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/systemd/generate')
-rw-r--r--pkg/systemd/generate/containers.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/systemd/generate/containers.go b/pkg/systemd/generate/containers.go
index caf5de357..a4fdae46e 100644
--- a/pkg/systemd/generate/containers.go
+++ b/pkg/systemd/generate/containers.go
@@ -220,6 +220,9 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
case "--replace":
hasReplaceParam = true
}
+ if strings.HasPrefix(p, "--name=") {
+ hasNameParam = true
+ }
}
if !hasDetachParam {