diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-03-31 07:30:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 07:30:46 -0400 |
commit | 4ba71f955a944790edda6e007e6d074009d437a7 (patch) | |
tree | dc654d918cd0fb947670f44769a57e0faac62fed /test | |
parent | c08e8c30a1069acab69bd5704c6362c7c90252d6 (diff) | |
parent | daeea48df5061d1d7a7207995fa166c2106ba3ae (diff) | |
download | podman-4ba71f955a944790edda6e007e6d074009d437a7.tar.gz podman-4ba71f955a944790edda6e007e6d074009d437a7.tar.bz2 podman-4ba71f955a944790edda6e007e6d074009d437a7.zip |
Merge pull request #13732 from flouthoc/reuse-configmap-volume
kube: `configmap` volume should be reused if already exists
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/play_kube_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index 6a4083565..f16180854 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -1679,6 +1679,32 @@ var _ = Describe("Podman play kube", func() { Expect(inspect.OutputToString()).To(ContainSubstring(`FOO=foo`)) }) + It("podman play kube test env value from configmap and --replace should reuse the configmap volume", func() { + SkipIfRemote("configmap list is not supported as a param") + cmYamlPathname := filepath.Join(podmanTest.TempDir, "foo-cm.yaml") + cm := getConfigMap(withConfigMapName("foo"), withConfigMapData("FOO", "foo")) + err := generateKubeYaml("configmap", cm, cmYamlPathname) + Expect(err).To(BeNil()) + + pod := getPod(withCtr(getCtr(withEnv("FOO", "", "configmap", "foo", "FOO", false)))) + err = generateKubeYaml("pod", pod, kubeYaml) + Expect(err).To(BeNil()) + + kube := podmanTest.Podman([]string{"play", "kube", kubeYaml, "--configmap", cmYamlPathname}) + kube.WaitWithDefaultTimeout() + Expect(kube).Should(Exit(0)) + + // create pod again with --replace + kube = podmanTest.Podman([]string{"play", "kube", "--replace", kubeYaml, "--configmap", cmYamlPathname}) + kube.WaitWithDefaultTimeout() + Expect(kube).Should(Exit(0)) + + inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(pod), "--format", "'{{ .Config.Env }}'"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect).Should(Exit(0)) + Expect(inspect.OutputToString()).To(ContainSubstring(`FOO=foo`)) + }) + It("podman play kube test required env value from configmap with missing key", func() { SkipIfRemote("configmap list is not supported as a param") cmYamlPathname := filepath.Join(podmanTest.TempDir, "foo-cm.yaml") |