From 09d9d3e26b1fdcb2ab800202bc2eb5ed943dd31b Mon Sep 17 00:00:00 2001 From: Ygal Blum Date: Mon, 12 May 2025 09:30:53 -0400 Subject: [PATCH] Revert "Quadlet - fix pod name to depend on the name of the generate service" This reverts commit 4f38c2fea2f945388491c35327d905cba36f8a5b. Fixes: #26105 Signed-off-by: Ygal Blum --- pkg/systemd/quadlet/quadlet.go | 2 +- test/e2e/quadlet/basic.pod | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go index 537986b8a4..5856e1b3eb 100644 --- a/pkg/systemd/quadlet/quadlet.go +++ b/pkg/systemd/quadlet/quadlet.go @@ -1482,7 +1482,7 @@ func GetPodResourceName(podUnit *parser.UnitFile) string { // Derive pod name from unit name (with added prefix), or use user-provided name. podName, ok := podUnit.Lookup(PodGroup, KeyPodName) if !ok || len(podName) == 0 { - podName = "systemd-%N" + podName = removeExtension(podUnit.Filename, "systemd-", "") } return podName } diff --git a/test/e2e/quadlet/basic.pod b/test/e2e/quadlet/basic.pod index 29ce391162..6e482e1940 100644 --- a/test/e2e/quadlet/basic.pod +++ b/test/e2e/quadlet/basic.pod @@ -1,9 +1,9 @@ ## assert-key-is Unit RequiresMountsFor "%t/containers" ## assert-key-is Service Type forking ## assert-key-is Service SyslogIdentifier "%N" -## assert-key-is-regex Service ExecStartPre ".*/podman pod create --infra-conmon-pidfile=%t/%N.pid --exit-policy=stop --replace --infra-name systemd-%N-infra --name systemd-%N" -## assert-key-is-regex Service ExecStart ".*/podman pod start systemd-%N" -## assert-key-is-regex Service ExecStop ".*/podman pod stop --ignore --time=10 systemd-%N" -## assert-key-is-regex Service ExecStopPost ".*/podman pod rm --ignore --force systemd-%N" +## assert-key-is-regex Service ExecStartPre ".*/podman pod create --infra-conmon-pidfile=%t/%N.pid --exit-policy=stop --replace --infra-name systemd-basic-infra --name systemd-basic" +## assert-key-is-regex Service ExecStart ".*/podman pod start systemd-basic" +## assert-key-is-regex Service ExecStop ".*/podman pod stop --ignore --time=10 systemd-basic" +## assert-key-is-regex Service ExecStopPost ".*/podman pod rm --ignore --force systemd-basic" [Pod]