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 <ygal.blum@gmail.com>
This commit is contained in:
Ygal Blum
2025-05-12 09:30:53 -04:00
parent c0b352f2eb
commit 09d9d3e26b
2 changed files with 5 additions and 5 deletions

View File

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

View File

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