summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoaz Shuster <boaz.shuster.github@gmail.com>2021-11-08 16:56:06 +0200
committerBoaz Shuster <boaz.shuster.github@gmail.com>2021-11-09 11:54:18 +0200
commit6ee3b33d3825177033763e51f756209102e0a309 (patch)
treeb456161925158c25c9413e6094c3ec684070376c
parent15eb016017e39c7370d169790e15744746d54cd7 (diff)
downloadpodman-6ee3b33d3825177033763e51f756209102e0a309.tar.gz
podman-6ee3b33d3825177033763e51f756209102e0a309.tar.bz2
podman-6ee3b33d3825177033763e51f756209102e0a309.zip
change from run to create in 250-systemd.bats
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
-rw-r--r--pkg/systemd/generate/containers.go4
-rw-r--r--test/system/250-systemd.bats2
2 files changed, 5 insertions, 1 deletions
diff --git a/pkg/systemd/generate/containers.go b/pkg/systemd/generate/containers.go
index c0a49c614..a4b18ec88 100644
--- a/pkg/systemd/generate/containers.go
+++ b/pkg/systemd/generate/containers.go
@@ -394,6 +394,10 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
info.IdentifySpecifier = true
runIx := -1
nameIx := -1
+ // Add systemd identify specifier next to the name value
+ // to set a name to the container according to the parameters passed to systemd.
+ // In case no --name set for that container, use ServiceName specified
+ // in the containerInfo struct.
for argIx, arg := range startCommand {
if arg == "run" {
runIx = argIx
diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats
index 28e28b30c..1c778a5e3 100644
--- a/test/system/250-systemd.bats
+++ b/test/system/250-systemd.bats
@@ -204,7 +204,7 @@ LISTEN_FDNAMES=listen_fdnames" "LISTEN Environment passed: $context"
@test "podman generate - systemd template" {
cname=$(random_string)
- run_podman run -dt --name $cname $IMAGE top
+ run_podman create --name $cname $IMAGE top
run_podman generate systemd --template -n $cname
echo "$output" > "$TEMPLATE_FILE_PREFIX@.service"