summaryrefslogtreecommitdiff
path: root/test/e2e/play_kube_test.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-02-11 17:18:09 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-02-13 05:46:27 -0500
commit5418c9c06b077e206f1ae837c4b395539059ebd7 (patch)
treee7bfb031709ba3550dfae02f31bdce721b027bd0 /test/e2e/play_kube_test.go
parent2814995a9281b3b8e67d7c48df28de0de742b995 (diff)
downloadpodman-5418c9c06b077e206f1ae837c4b395539059ebd7.tar.gz
podman-5418c9c06b077e206f1ae837c4b395539059ebd7.tar.bz2
podman-5418c9c06b077e206f1ae837c4b395539059ebd7.zip
Fix up play kube to use image data
podman play kube was ignoring the imageData.Config Volumes WorkingDir Labels StopSignal Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e/play_kube_test.go')
-rw-r--r--test/e2e/play_kube_test.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 8411e632a..9daf266b8 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -4,6 +4,7 @@ package integration
import (
"fmt"
+ "io/ioutil"
"os"
"path/filepath"
"text/template"
@@ -486,4 +487,46 @@ var _ = Describe("Podman generate kube", func() {
newBBinspect := inspect.InspectImageJSON()
Expect(oldBBinspect[0].Digest).To(Not(Equal(newBBinspect[0].Digest)))
})
+
+ It("podman play kube with image data", func() {
+ testyaml := `
+apiVersion: v1
+kind: Pod
+metadata:
+ name: demo_pod
+spec:
+ containers:
+ - image: demo
+ name: demo_kube
+`
+ pull := podmanTest.Podman([]string{"create", "--workdir", "/etc", "--name", "newBB", "--label", "key1=value1", "alpine"})
+
+ pull.WaitWithDefaultTimeout()
+ Expect(pull.ExitCode()).To(BeZero())
+
+ c := podmanTest.Podman([]string{"commit", "-c", "STOPSIGNAL=51", "newBB", "demo"})
+ c.WaitWithDefaultTimeout()
+ Expect(c.ExitCode()).To(Equal(0))
+
+ conffile := filepath.Join(podmanTest.TempDir, "kube.yaml")
+ tempdir, err = CreateTempDirInTempDir()
+ Expect(err).To(BeNil())
+
+ err := ioutil.WriteFile(conffile, []byte(testyaml), 0755)
+ Expect(err).To(BeNil())
+
+ kube := podmanTest.Podman([]string{"play", "kube", conffile})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube.ExitCode()).To(Equal(0))
+
+ inspect := podmanTest.Podman([]string{"inspect", "demo_kube"})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect.ExitCode()).To(Equal(0))
+
+ ctr := inspect.InspectContainerToJSON()
+ Expect(ctr[0].Config.WorkingDir).To(ContainSubstring("/etc"))
+ Expect(ctr[0].Config.Labels["key1"]).To(ContainSubstring("value1"))
+ Expect(ctr[0].Config.Labels["key1"]).To(ContainSubstring("value1"))
+ Expect(ctr[0].Config.StopSignal).To(Equal(uint(51)))
+ })
})