summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-21 07:29:25 -0500
committerGitHub <noreply@github.com>2022-01-21 07:29:25 -0500
commit3074a98378e7916fde46981f4f5c0885754a13f2 (patch)
treef44e90fe6d73078e3abd20be465da5f968e3194b /test
parent11c5717cdb5a019ff416fa07b9192cc87c29c13d (diff)
parent9d815707e226b432ebd38682826a96e7a00cb46e (diff)
downloadpodman-3074a98378e7916fde46981f4f5c0885754a13f2.tar.gz
podman-3074a98378e7916fde46981f4f5c0885754a13f2.tar.bz2
podman-3074a98378e7916fde46981f4f5c0885754a13f2.zip
Merge pull request #12943 from machacekondra/nil_fix
Fix nil pointer dereference for configmap optional
Diffstat (limited to 'test')
-rw-r--r--test/e2e/play_kube_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 63c9bf7f3..cbaa8d6a4 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -78,6 +78,25 @@ spec:
- 24h
status: {}
`
+
+var podWithoutConfigMapDefined = `
+apiVersion: v1
+kind: Pod
+metadata:
+ name: testpod1
+spec:
+ containers:
+ - name: alpine
+ image: quay.io/libpod/alpine:latest
+ volumeMounts:
+ - name: mycm
+ mountPath: /mycm
+ volumes:
+ - name: mycm
+ configMap:
+ name: mycm
+`
+
var sharedNamespacePodYaml = `
apiVersion: v1
kind: Pod
@@ -1235,6 +1254,16 @@ var _ = Describe("Podman play kube", func() {
}
})
+ It("podman play kube with non-existing configmap", func() {
+ err := writeYaml(podWithoutConfigMapDefined, kubeYaml)
+ Expect(err).To(BeNil())
+
+ kube := podmanTest.Podman([]string{"play", "kube", kubeYaml})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube).Should(Exit(125))
+ Expect(kube.ErrorToString()).To(ContainSubstring("failed to create volume \"mycm\": no such ConfigMap \"mycm\""))
+ })
+
It("podman play kube test HostAliases with --no-hosts", func() {
pod := getPod(withHostAliases("192.168.1.2", []string{
"test1.podman.io",