diff options
Diffstat (limited to 'cmd/podman/play/kube.go')
-rw-r--r-- | cmd/podman/play/kube.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go index 4c0f7f39e..30d6d86f0 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), @@ -65,6 +65,10 @@ func init() { flags.StringVar(&kubeOptions.Network, networkFlagName, "", "Connect pod to CNI network(s)") _ = kubeCmd.RegisterFlagCompletionFunc(networkFlagName, common.AutocompleteNetworkFlag) + staticIPFlagName := "ip" + flags.IPSliceVar(&kubeOptions.StaticIPs, staticIPFlagName, nil, "Static IP addresses to assign to the pods") + _ = kubeCmd.RegisterFlagCompletionFunc(staticIPFlagName, completion.AutocompleteNone) + logDriverFlagName := "log-driver" flags.StringVar(&kubeOptions.LogDriver, logDriverFlagName, "", "Logging driver for the container") _ = kubeCmd.RegisterFlagCompletionFunc(logDriverFlagName, common.AutocompleteLogDriver) @@ -129,6 +133,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) |