Skip to content

Commit 2df994b

Browse files
committed
quadlet: Don't put @ in container names for templated units
This is not supported by podman, so we make "foo@bar" into "foo_bar". Signed-off-by: Alexander Larsson <[email protected]>
1 parent 51c1140 commit 2df994b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/systemd/quadlet/quadlet.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,11 @@ func ConvertContainer(container *parser.UnitFile, names map[string]string, isUse
439439
containerName, ok := container.Lookup(ContainerGroup, KeyContainerName)
440440
if !ok || len(containerName) == 0 {
441441
// By default, We want to name the container by the service name
442-
containerName = "systemd-%N"
442+
if strings.Contains(container.Filename, "@") {
443+
containerName = "systemd-%P_%I"
444+
} else {
445+
containerName = "systemd-%N"
446+
}
443447
}
444448

445449
// Set PODMAN_SYSTEMD_UNIT so that podman auto-update can restart the service.

0 commit comments

Comments
 (0)