aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2020-12-02 16:06:31 -0600
committerbaude <bbaude@redhat.com>2020-12-07 11:34:39 -0600
commit749ee2a10ed689a06da699659c59872c0ed770d7 (patch)
tree496d31fdaa07af5778214d6c22ea0222f50ded9b /cmd
parente6f80fa61aa082d2226b8258ea247186451d84d3 (diff)
downloadpodman-749ee2a10ed689a06da699659c59872c0ed770d7.tar.gz
podman-749ee2a10ed689a06da699659c59872c0ed770d7.tar.bz2
podman-749ee2a10ed689a06da699659c59872c0ed770d7.zip
generate kube on multiple containers
add the ability to add multiple containers into a single k8s pod instead of just one. also fixed some bugs in the resulting yaml where an empty service description was being added on error causing the k8s validation to fail. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/generate/kube.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/podman/generate/kube.go b/cmd/podman/generate/kube.go
index e47bd35b5..0517db19a 100644
--- a/cmd/podman/generate/kube.go
+++ b/cmd/podman/generate/kube.go
@@ -17,16 +17,16 @@ import (
var (
kubeOptions = entities.GenerateKubeOptions{}
kubeFile = ""
- kubeDescription = `Command generates Kubernetes pod and service YAML (v1 specification) from a Podman container or pod.
+ kubeDescription = `Command generates Kubernetes pod and service YAML (v1 specification) from Podman containers or a pod.
Whether the input is for a container or pod, Podman will always generate the specification as a pod.`
kubeCmd = &cobra.Command{
- Use: "kube [options] CONTAINER | POD",
+ Use: "kube [options] CONTAINER... | POD",
Short: "Generate Kubernetes YAML from a container or pod.",
Long: kubeDescription,
RunE: kube,
- Args: cobra.ExactArgs(1),
+ Args: cobra.MinimumNArgs(1),
ValidArgsFunction: common.AutocompleteContainersAndPods,
Example: `podman generate kube ctrID
podman generate kube podID
@@ -51,7 +51,7 @@ func init() {
}
func kube(cmd *cobra.Command, args []string) error {
- report, err := registry.ContainerEngine().GenerateKube(registry.GetContext(), args[0], kubeOptions)
+ report, err := registry.ContainerEngine().GenerateKube(registry.GetContext(), args, kubeOptions)
if err != nil {
return err
}