aboutsummaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorcdoern <cbdoer23@g.holycross.edu>2022-05-03 22:26:43 -0400
committerMatthew Heon <mheon@redhat.com>2022-06-14 13:08:53 -0400
commit8a7e280945c182b7feed68f6c9d2166136526040 (patch)
tree7760cb3bc1d795b3f0718f3a713e0de446e0e25b /test/e2e
parenta1ec21dac104d811d5a22a663181a503177d5187 (diff)
downloadpodman-8a7e280945c182b7feed68f6c9d2166136526040.tar.gz
podman-8a7e280945c182b7feed68f6c9d2166136526040.tar.bz2
podman-8a7e280945c182b7feed68f6c9d2166136526040.zip
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>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/play_kube_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 45414ec04..1b223637e 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -3536,4 +3536,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}}"))
+
+ })
})