summaryrefslogtreecommitdiff
path: root/cmd/podman/generate_kube.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/generate_kube.go')
-rw-r--r--cmd/podman/generate_kube.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd/podman/generate_kube.go b/cmd/podman/generate_kube.go
index fa2872b77..42cfba8d8 100644
--- a/cmd/podman/generate_kube.go
+++ b/cmd/podman/generate_kube.go
@@ -15,10 +15,12 @@ import (
var (
containerKubeCommand cliconfig.GenerateKubeValues
- containerKubeDescription = "Generate Kubernetes Pod YAML"
- _containerKubeCommand = &cobra.Command{
+ containerKubeDescription = `Command generates Kubernetes Pod YAML (v1 specification) from a podman container or pod.
+
+ Whether the input is for a container or pod, Podman will always generate the specification as a Pod. The input may be in the form of a pod or container name or ID.`
+ _containerKubeCommand = &cobra.Command{
Use: "kube [flags] CONTAINER | POD",
- Short: "Generate Kubernetes pod YAML for a container or pod",
+ Short: "Generate Kubernetes pod YAML from a container or pod",
Long: containerKubeDescription,
RunE: func(cmd *cobra.Command, args []string) error {
containerKubeCommand.InputArgs = args
@@ -33,6 +35,7 @@ var (
func init() {
containerKubeCommand.Command = _containerKubeCommand
+ containerKubeCommand.SetHelpTemplate(HelpTemplate())
containerKubeCommand.SetUsageTemplate(UsageTemplate())
flags := containerKubeCommand.Flags()
flags.BoolVarP(&containerKubeCommand.Service, "service", "s", false, "Generate YAML for kubernetes service object")
@@ -54,8 +57,8 @@ func generateKubeYAMLCmd(c *cliconfig.GenerateKubeValues) error {
return errors.Wrapf(libpod.ErrNotImplemented, "rootless users")
}
args := c.InputArgs
- if len(args) > 1 || (len(args) < 1 && !c.Bool("latest")) {
- return errors.Errorf("you must provide one container|pod ID or name or --latest")
+ if len(args) != 1 {
+ return errors.Errorf("you must provide exactly one container|pod ID or name")
}
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)