summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-06-11 10:28:49 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-06-11 11:26:46 -0400
commitf909b745ec82d6c010e27218bda9524bb1724060 (patch)
tree9095186eb1b8c790a953dfffea9ee6de27185ecd /test
parent53435d4d4726250f38054b934246ec4d8b1f7581 (diff)
downloadpodman-f909b745ec82d6c010e27218bda9524bb1724060.tar.gz
podman-f909b745ec82d6c010e27218bda9524bb1724060.tar.bz2
podman-f909b745ec82d6c010e27218bda9524bb1724060.zip
Add --filename option to generate kube
This allows writing output directly to a file, instead of STDOUT. Makes things easier for some scripting tasks. Like the unit tests for 'play kube'. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/generate_kube_test.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go
index d4eba31e8..40cc534c2 100644
--- a/test/e2e/generate_kube_test.go
+++ b/test/e2e/generate_kube_test.go
@@ -3,7 +3,6 @@
package integration
import (
- "io/ioutil"
"os"
"path/filepath"
@@ -120,14 +119,11 @@ var _ = Describe("Podman generate kube", func() {
session2.WaitWithDefaultTimeout()
Expect(session2.ExitCode()).To(Equal(0))
- kube := podmanTest.Podman([]string{"generate", "kube", podName})
+ outputFile := filepath.Join(podmanTest.RunRoot, "pod.yaml")
+ kube := podmanTest.Podman([]string{"generate", "kube", "-f", outputFile, podName})
kube.WaitWithDefaultTimeout()
Expect(kube.ExitCode()).To(Equal(0))
- outputFile := filepath.Join(podmanTest.RunRoot, "pod.yaml")
- err := ioutil.WriteFile(outputFile, []byte(kube.OutputToString()), 0644)
- Expect(err).To(BeNil())
-
session3 := podmanTest.Podman([]string{"pod", "rm", "-af"})
session3.WaitWithDefaultTimeout()
Expect(session3.ExitCode()).To(Equal(0))