mirror of https://github.com/containers/podman.git
Quadlet - Do not override existing Environment in Service group for Pod units
Fixes: #26521 Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
parent
1a3b35673d
commit
f1a1948b23
|
@ -1588,8 +1588,10 @@ func ConvertPod(podUnit *parser.UnitFile, name string, unitsInfoMap map[string]*
|
||||||
|
|
||||||
service.AddCmdline(ServiceGroup, "ExecStartPre", execStartPre.Args)
|
service.AddCmdline(ServiceGroup, "ExecStartPre", execStartPre.Args)
|
||||||
|
|
||||||
|
// Set PODMAN_SYSTEMD_UNIT so that podman auto-update can restart the service.
|
||||||
|
service.Add(ServiceGroup, "Environment", "PODMAN_SYSTEMD_UNIT=%n")
|
||||||
|
|
||||||
service.Setv(ServiceGroup,
|
service.Setv(ServiceGroup,
|
||||||
"Environment", "PODMAN_SYSTEMD_UNIT=%n",
|
|
||||||
"Type", "forking",
|
"Type", "forking",
|
||||||
"Restart", "on-failure",
|
"Restart", "on-failure",
|
||||||
"PIDFile", "%t/%N.pid",
|
"PIDFile", "%t/%N.pid",
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
## assert-key-is Service Environment key1=value1 key2=value2 PODMAN_SYSTEMD_UNIT=%n
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=key1=value1
|
||||||
|
Environment=key2=value2
|
||||||
|
|
||||||
|
[Pod]
|
|
@ -1089,6 +1089,7 @@ BOGUS=foo
|
||||||
Entry("Pod - Remap keep-id", "remap-keep-id.pod"),
|
Entry("Pod - Remap keep-id", "remap-keep-id.pod"),
|
||||||
Entry("Pod - Remap manual", "remap-manual.pod"),
|
Entry("Pod - Remap manual", "remap-manual.pod"),
|
||||||
Entry("Pod - Shm Size", "shmsize.pod"),
|
Entry("Pod - Shm Size", "shmsize.pod"),
|
||||||
|
Entry("Pod - Service Environment", "service-environment.pod"),
|
||||||
)
|
)
|
||||||
|
|
||||||
DescribeTable("Running expected warning quadlet test case",
|
DescribeTable("Running expected warning quadlet test case",
|
||||||
|
|
Loading…
Reference in New Issue