mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
play kube log tag handling
currently tags cause a panic due to an uninitialized map. Initialize the map and add parsing to make sure we are only tagging with journald resolves #13356 Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
This commit is contained in:
@ -3535,4 +3535,24 @@ ENV OPENJ9_JAVA_OPTIONS=%q
|
||||
Expect(kube.ErrorToString()).To(ContainSubstring("ambiguous configuration: the same config map foo is present in YAML and in --configmaps"))
|
||||
})
|
||||
})
|
||||
|
||||
It("podman play kube --log-opt = tag test", func() {
|
||||
pod := getPod()
|
||||
err := generateKubeYaml("pod", pod, kubeYaml)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
kube := podmanTest.Podman([]string{"play", "kube", kubeYaml, "--log-driver", "journald", "--log-opt", "tag={{.ImageName}}"})
|
||||
kube.WaitWithDefaultTimeout()
|
||||
Expect(kube).Should(Exit(0))
|
||||
|
||||
start := podmanTest.Podman([]string{"start", getCtrNameInPod(pod)})
|
||||
start.WaitWithDefaultTimeout()
|
||||
Expect(start).Should(Exit(0))
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(pod)})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(start).Should(Exit(0))
|
||||
Expect((inspect.InspectContainerToJSON()[0]).HostConfig.LogConfig.Tag).To(Equal("{{.ImageName}}"))
|
||||
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user