mirror of
https://github.com/containers/podman.git
synced 2025-10-15 02:06:42 +08:00
Merge pull request #26522 from ygalblum/quadlet-pod-service-environment
Quadlet - Do not override existing Environment in Service group for Pod units
This commit is contained in:
@ -1588,8 +1588,10 @@ func ConvertPod(podUnit *parser.UnitFile, name string, unitsInfoMap map[string]*
|
||||
|
||||
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,
|
||||
"Environment", "PODMAN_SYSTEMD_UNIT=%n",
|
||||
"Type", "forking",
|
||||
"Restart", "on-failure",
|
||||
"PIDFile", "%t/%N.pid",
|
||||
|
7
test/e2e/quadlet/service-environment.pod
Normal file
7
test/e2e/quadlet/service-environment.pod
Normal file
@ -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 manual", "remap-manual.pod"),
|
||||
Entry("Pod - Shm Size", "shmsize.pod"),
|
||||
Entry("Pod - Service Environment", "service-environment.pod"),
|
||||
)
|
||||
|
||||
DescribeTable("Running expected warning quadlet test case",
|
||||
|
Reference in New Issue
Block a user