summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-08-17 16:35:34 +0000
committerGitHub <noreply@github.com>2022-08-17 16:35:34 +0000
commit5de215e1447af96ec2b199794cd425b75a2da08a (patch)
tree0e31c520ed94cd9d675748d798c2ba2f423752b3 /cmd
parentf70c9cd78bd377ddc01acc67f00af38325f40edd (diff)
parent5f09d9b60d11b6d96b394a8266e30b3edf0519b6 (diff)
downloadpodman-5de215e1447af96ec2b199794cd425b75a2da08a.tar.gz
podman-5de215e1447af96ec2b199794cd425b75a2da08a.tar.bz2
podman-5de215e1447af96ec2b199794cd425b75a2da08a.zip
Merge pull request #15341 from rhatdan/kube
Fix podman kube generate --help to show correct help message
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/kube/generate.go29
1 files changed, 10 insertions, 19 deletions
diff --git a/cmd/podman/kube/generate.go b/cmd/podman/kube/generate.go
index 6df4b55fc..ee2ea51ae 100644
--- a/cmd/podman/kube/generate.go
+++ b/cmd/podman/kube/generate.go
@@ -22,7 +22,7 @@ var (
Whether the input is for a container or pod, Podman will always generate the specification as a pod.`
- generateKubeCmd = &cobra.Command{
+ kubeGenerateCmd = &cobra.Command{
Use: "generate [options] {CONTAINER...|POD...|VOLUME...}",
Short: "Generate Kubernetes YAML from containers, pods or volumes.",
Long: generateDescription,
@@ -35,33 +35,28 @@ var (
podman kube generate volumeName
podman kube generate ctrID podID volumeName --service`,
}
- kubeGenerateDescription = generateDescription
- kubeGenerateCmd = &cobra.Command{
+ generateKubeCmd = &cobra.Command{
Use: "kube [options] {CONTAINER...|POD...|VOLUME...}",
- Short: "Generate Kubernetes YAML from containers, pods or volumes.",
- Long: kubeGenerateDescription,
- RunE: kubeGenerate,
- Args: cobra.MinimumNArgs(1),
- ValidArgsFunction: common.AutocompleteForGenerate,
- Example: `podman kube generate ctrID
- podman kube generate podID
- podman kube generate --service podID
- podman kube generate volumeName
- podman kube generate ctrID podID volumeName --service`,
+ Short: kubeGenerateCmd.Short,
+ Long: kubeGenerateCmd.Long,
+ RunE: kubeGenerateCmd.RunE,
+ Args: kubeGenerateCmd.Args,
+ ValidArgsFunction: kubeGenerateCmd.ValidArgsFunction,
+ Example: kubeGenerateCmd.Example,
}
)
func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{
Command: generateKubeCmd,
- Parent: kubeCmd,
+ Parent: generate.GenerateCmd,
})
generateFlags(generateKubeCmd)
registry.Commands = append(registry.Commands, registry.CliCommand{
Command: kubeGenerateCmd,
- Parent: generate.GenerateCmd,
+ Parent: kubeCmd,
})
generateFlags(kubeGenerateCmd)
}
@@ -103,7 +98,3 @@ func generateKube(cmd *cobra.Command, args []string) error {
fmt.Println(string(content))
return nil
}
-
-func kubeGenerate(cmd *cobra.Command, args []string) error {
- return generateKube(cmd, args)
-}