mirror of
https://github.com/containers/podman.git
synced 2025-10-25 10:16:43 +08:00
Quadlet Kube: Set SyslogIdentifier if was not set
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
@ -638,6 +638,10 @@ func ConvertKube(kube *parser.UnitFile) (*parser.UnitFile, error) {
|
||||
"Type", "notify",
|
||||
"NotifyAccess", "all")
|
||||
|
||||
if !kube.HasKey(ServiceGroup, "SyslogIdentifier") {
|
||||
service.Set(ServiceGroup, "SyslogIdentifier", "%N")
|
||||
}
|
||||
|
||||
execStart := NewPodmanCmdline("kube", "play")
|
||||
|
||||
execStart.add(
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
## assert-key-is "Service" "Type" "notify"
|
||||
## assert-key-is "Service" "NotifyAccess" "all"
|
||||
## assert-key-is "Service" "Environment" "PODMAN_SYSTEMD_UNIT=%n"
|
||||
|
||||
## assert-key-is "Service" "SyslogIdentifier" "%N"
|
||||
|
||||
[Kube]
|
||||
Yaml=deployment.yml
|
||||
|
||||
20
test/e2e/quadlet/syslog.identifier.kube
Normal file
20
test/e2e/quadlet/syslog.identifier.kube
Normal file
@ -0,0 +1,20 @@
|
||||
## assert-podman-args "kube"
|
||||
## assert-podman-args "play"
|
||||
## assert-podman-final-args deployment.yml
|
||||
## assert-podman-args "--replace"
|
||||
## assert-podman-args "--service-container=true"
|
||||
## assert-podman-stop-args "kube"
|
||||
## assert-podman-stop-args "down"
|
||||
## assert-podman-stop-final-args deployment.yml
|
||||
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
||||
## assert-key-is "Service" "KillMode" "mixed"
|
||||
## assert-key-is "Service" "Type" "notify"
|
||||
## assert-key-is "Service" "NotifyAccess" "all"
|
||||
## assert-key-is "Service" "Environment" "PODMAN_SYSTEMD_UNIT=%n"
|
||||
## assert-key-is "Service" "SyslogIdentifier" "mytest"
|
||||
|
||||
[Service]
|
||||
SyslogIdentifier=mytest
|
||||
|
||||
[Kube]
|
||||
Yaml=deployment.yml
|
||||
@ -322,6 +322,7 @@ var _ = Describe("quadlet system generator", func() {
|
||||
Entry("uid.volume", "uid.volume"),
|
||||
|
||||
Entry("Basic kube", "basic.kube"),
|
||||
Entry("Syslog Identifier", "syslog.identifier.kube"),
|
||||
)
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user