From 6ee3b33d3825177033763e51f756209102e0a309 Mon Sep 17 00:00:00 2001 From: Boaz Shuster Date: Mon, 8 Nov 2021 16:56:06 +0200 Subject: change from run to create in 250-systemd.bats Signed-off-by: Boaz Shuster --- pkg/systemd/generate/containers.go | 4 ++++ test/system/250-systemd.bats | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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" -- cgit v1.2.3-54-g00ecf