summaryrefslogtreecommitdiff
path: root/cmd/podman/play
diff options
context:
space:
mode:
authorEduardo Vega <edvegavalerio@gmail.com>2021-03-26 18:16:41 -0600
committerEduardo Vega <edvegavalerio@gmail.com>2021-04-09 14:01:13 -0600
commit61cb6d61dd420a000c843171b5917b5595874a67 (patch)
treeb56af885a529beb0ddf0386b090bc7cda5c93b49 /cmd/podman/play
parentf143de9db6861cd8b8d6fc4e03f2826041307982 (diff)
downloadpodman-61cb6d61dd420a000c843171b5917b5595874a67.tar.gz
podman-61cb6d61dd420a000c843171b5917b5595874a67.tar.bz2
podman-61cb6d61dd420a000c843171b5917b5595874a67.zip
Add support for play/generate kube volumes
Signed-off-by: Eduardo Vega <edvegavalerio@gmail.com>
Diffstat (limited to 'cmd/podman/play')
-rw-r--r--cmd/podman/play/kube.go13
-rw-r--r--cmd/podman/play/play.go4
2 files changed, 13 insertions, 4 deletions
diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go
index 4c0f7f39e..ddba5dc0f 100644
--- a/cmd/podman/play/kube.go
+++ b/cmd/podman/play/kube.go
@@ -32,11 +32,11 @@ var (
kubeOptions = playKubeOptionsWrapper{}
kubeDescription = `Command reads in a structured file of Kubernetes YAML.
- 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.`
+ It creates pods or volumes based on the Kubernetes kind described in the YAML. Supported kinds are Pods, Deployments and PersistentVolumeClaims.`
kubeCmd = &cobra.Command{
Use: "kube [options] KUBEFILE|-",
- Short: "Play a pod based on Kubernetes YAML.",
+ Short: "Play a pod or volume based on Kubernetes YAML.",
Long: kubeDescription,
RunE: kube,
Args: cobra.ExactArgs(1),
@@ -129,6 +129,15 @@ func kube(cmd *cobra.Command, args []string) error {
return err
}
+ // Print volumes report
+ for i, volume := range report.Volumes {
+ if i == 0 {
+ fmt.Println("Volumes:")
+ }
+ fmt.Println(volume.Name)
+ }
+
+ // Print pods report
for _, pod := range report.Pods {
for _, l := range pod.Logs {
fmt.Fprint(os.Stderr, l)
diff --git a/cmd/podman/play/play.go b/cmd/podman/play/play.go
index 92f87ad80..89c7e0139 100644
--- a/cmd/podman/play/play.go
+++ b/cmd/podman/play/play.go
@@ -11,8 +11,8 @@ var (
// Command: podman _play_
playCmd = &cobra.Command{
Use: "play",
- Short: "Play a pod and its containers from a structured file.",
- Long: "Play structured data (e.g., Kubernetes pod or service yaml) based on containers and pods.",
+ Short: "Play containers, pods or volumes from a structured file.",
+ Long: "Play structured data (e.g., Kubernetes YAML) based on containers, pods or volumes.",
RunE: validate.SubCommandExists,
}
)