summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-22 09:08:33 -0500
committerGitHub <noreply@github.com>2021-02-22 09:08:33 -0500
commit6fbf73ed8bd34738f3f901df1e5d3b592a9c3354 (patch)
tree84e9ad888d9f633ec02c8b1840d380dd25e536e9 /cmd
parent5da7c69968cb14120dba71de0c900902013c4517 (diff)
parentf06dd45e0c1b4a36bb93f33cc863d54af94b5155 (diff)
downloadpodman-6fbf73ed8bd34738f3f901df1e5d3b592a9c3354.tar.gz
podman-6fbf73ed8bd34738f3f901df1e5d3b592a9c3354.tar.bz2
podman-6fbf73ed8bd34738f3f901df1e5d3b592a9c3354.zip
Merge pull request #9420 from rhatdan/kube
[NO TESTS NEEDED] Allow podman play kube to read yaml file from stdin
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/play/kube.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go
index 5650ad1be..4c0f7f39e 100644
--- a/cmd/podman/play/kube.go
+++ b/cmd/podman/play/kube.go
@@ -35,13 +35,14 @@ var (
It creates the pod and containers described in the YAML. The containers within the pod are then started and the ID of the new Pod is output.`
kubeCmd = &cobra.Command{
- Use: "kube [options] KUBEFILE",
+ Use: "kube [options] KUBEFILE|-",
Short: "Play a pod based on Kubernetes YAML.",
Long: kubeDescription,
RunE: kube,
Args: cobra.ExactArgs(1),
ValidArgsFunction: common.AutocompleteDefaultOneArg,
Example: `podman play kube nginx.yml
+ cat nginx.yml | podman play kube -
podman play kube --creds user:password --seccomp-profile-root /custom/path apache.yml`,
}
)
@@ -119,7 +120,11 @@ func kube(cmd *cobra.Command, args []string) error {
kubeOptions.Password = creds.Password
}
- report, err := registry.ContainerEngine().PlayKube(registry.GetContext(), args[0], kubeOptions.PlayKubeOptions)
+ yamlfile := args[0]
+ if yamlfile == "-" {
+ yamlfile = "/dev/stdin"
+ }
+ report, err := registry.ContainerEngine().PlayKube(registry.GetContext(), yamlfile, kubeOptions.PlayKubeOptions)
if err != nil {
return err
}