summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-24 12:41:28 +0100
committerGitHub <noreply@github.com>2022-03-24 12:41:28 +0100
commit2d46165799e39cb09a10484dc3a2720ebb8c0ec8 (patch)
tree63c85dc9926d3046e8d855f1794c054482de7226 /cmd
parent72660e377fe6a922cde5982da488760b48792717 (diff)
parent752680366c5896da6587d892ba719eb35dd1a859 (diff)
downloadpodman-2d46165799e39cb09a10484dc3a2720ebb8c0ec8.tar.gz
podman-2d46165799e39cb09a10484dc3a2720ebb8c0ec8.tar.bz2
podman-2d46165799e39cb09a10484dc3a2720ebb8c0ec8.zip
Merge pull request #13606 from paralin/play-kube-inmem
play: kube: support io.reader body arg and remove tempfiles
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/play/kube.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go
index 3067f0d54..e92516eb4 100644
--- a/cmd/podman/play/kube.go
+++ b/cmd/podman/play/kube.go
@@ -209,10 +209,15 @@ func teardown(yamlfile string) error {
podRmErrors utils.OutputErrors
)
options := new(entities.PlayKubeDownOptions)
- reports, err := registry.ContainerEngine().PlayKubeDown(registry.GetContext(), yamlfile, *options)
+ f, err := os.Open(yamlfile)
if err != nil {
return err
}
+ defer f.Close()
+ reports, err := registry.ContainerEngine().PlayKubeDown(registry.GetContext(), f, *options)
+ if err != nil {
+ return errors.Wrap(err, yamlfile)
+ }
// Output stopped pods
fmt.Println("Pods stopped:")
@@ -242,10 +247,15 @@ func teardown(yamlfile string) error {
}
func playkube(yamlfile string) error {
- report, err := registry.ContainerEngine().PlayKube(registry.GetContext(), yamlfile, kubeOptions.PlayKubeOptions)
+ f, err := os.Open(yamlfile)
if err != nil {
return err
}
+ defer f.Close()
+ report, err := registry.ContainerEngine().PlayKube(registry.GetContext(), f, kubeOptions.PlayKubeOptions)
+ if err != nil {
+ return errors.Wrap(err, yamlfile)
+ }
// Print volumes report
for i, volume := range report.Volumes {
if i == 0 {