mirror of https://github.com/k3s-io/k3s
some code change
fix wrong required flags disable the addition of [flags] to the usage, use customized useline fix function renamepull/6/head
parent
6c54ec59ee
commit
1c715d51c4
|
@ -27,7 +27,7 @@ import (
|
|||
// MarkdownPostProcessing goes though the generated files
|
||||
func MarkdownPostProcessing(cmd *cobra.Command, dir string, processor func(string) string) error {
|
||||
for _, c := range cmd.Commands() {
|
||||
if !c.IsAvailableCommand() || c.IsHelpCommand() {
|
||||
if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() {
|
||||
continue
|
||||
}
|
||||
if err := MarkdownPostProcessing(c, dir, processor); err != nil {
|
||||
|
|
|
@ -111,7 +111,7 @@ func NewCmdJoin(out io.Writer) *cobra.Command {
|
|||
var ignorePreflightErrors []string
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "join [flags]",
|
||||
Use: "join",
|
||||
Short: "Run this on any machine you wish to join an existing cluster",
|
||||
Long: joinLongDescription,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
|
|
@ -102,6 +102,7 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
|
|||
var printJoinCommand bool
|
||||
createCmd := &cobra.Command{
|
||||
Use: "create [token]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: "Create bootstrap tokens on the server.",
|
||||
Long: dedent.Dedent(`
|
||||
This command will create a bootstrap token for you.
|
||||
|
@ -156,6 +157,7 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
|
|||
|
||||
deleteCmd := &cobra.Command{
|
||||
Use: "delete [token-value]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: "Delete bootstrap tokens on the server.",
|
||||
Long: dedent.Dedent(`
|
||||
This command will delete a given bootstrap token for you.
|
||||
|
|
|
@ -70,6 +70,7 @@ func NewCmdApply(parentFlags *cmdUpgradeFlags) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "apply [version]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: "Upgrade your Kubernetes cluster to the specified version.",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
var err error
|
||||
|
|
|
@ -114,6 +114,7 @@ func NewCmdAnnotate(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Update the annotations on a resource"),
|
||||
Long: annotateLong + "\n\n" + cmdutil.ValidResourceTypeList(f),
|
||||
Example: annotateExample,
|
||||
|
|
|
@ -106,6 +106,7 @@ func NewCmdApply(baseName string, f cmdutil.Factory, out, errOut io.Writer) *cob
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "apply -f FILENAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Apply a configuration to a resource by filename or stdin"),
|
||||
Long: applyLong,
|
||||
Example: applyExample,
|
||||
|
|
|
@ -77,6 +77,7 @@ func NewCmdApplyEditLastApplied(f cmdutil.Factory, out, errOut io.Writer) *cobra
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "edit-last-applied (RESOURCE/NAME | -f FILENAME)",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: "Edit latest last-applied-configuration annotations of a resource/object",
|
||||
Long: applyEditLastAppliedLong,
|
||||
Example: applyEditLastAppliedExample,
|
||||
|
|
|
@ -85,6 +85,7 @@ func NewCmdApplySetLastApplied(f cmdutil.Factory, out, err io.Writer) *cobra.Com
|
|||
options := &SetLastAppliedOptions{Out: out, ErrOut: err}
|
||||
cmd := &cobra.Command{
|
||||
Use: "set-last-applied -f FILENAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Set the last-applied-configuration annotation on a live object to match the contents of a file."),
|
||||
Long: applySetLastAppliedLong,
|
||||
Example: applySetLastAppliedExample,
|
||||
|
|
|
@ -61,6 +61,7 @@ func NewCmdApplyViewLastApplied(f cmdutil.Factory, out, err io.Writer) *cobra.Co
|
|||
options := &ViewLastAppliedOptions{Out: out, ErrOut: err}
|
||||
cmd := &cobra.Command{
|
||||
Use: "view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME)",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("View latest last-applied-configuration annotations of a resource/object"),
|
||||
Long: applyViewLastAppliedLong,
|
||||
Example: applyViewLastAppliedExample,
|
||||
|
|
|
@ -72,6 +72,7 @@ func NewCmdAttach(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer)
|
|||
}
|
||||
cmd := &cobra.Command{
|
||||
Use: "attach (POD | TYPE/NAME) -c CONTAINER",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Attach to a running container"),
|
||||
Long: "Attach to a process that is already running inside an existing container.",
|
||||
Example: attachExample,
|
||||
|
|
|
@ -89,6 +89,7 @@ func NewCmdCanI(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "can-i VERB [TYPE | TYPE/NAME | NONRESOURCEURL]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: "Check whether an action is allowed",
|
||||
Long: canILong,
|
||||
Example: canIExample,
|
||||
|
|
|
@ -65,6 +65,7 @@ func NewCmdReconcile(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "reconcile -f FILENAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: "Reconciles rules for RBAC Role, RoleBinding, ClusterRole, and ClusterRole binding objects",
|
||||
Long: reconcileLong,
|
||||
Example: reconcileExample,
|
||||
|
|
|
@ -52,7 +52,8 @@ func NewCmdAutoscale(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
argAliases := kubectl.ResourceAliases(validArgs)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU] [flags]",
|
||||
Use: "autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Auto-scale a Deployment, ReplicaSet, or ReplicationController"),
|
||||
Long: autoscaleLong,
|
||||
Example: autoscaleExample,
|
||||
|
|
|
@ -33,6 +33,7 @@ import (
|
|||
func NewCmdCertificate(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "certificate SUBCOMMAND",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Modify certificate resources."),
|
||||
Long: "Modify certificate resources.",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
@ -69,6 +70,7 @@ func NewCmdCertificateApprove(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
options := CertificateOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "approve (-f FILENAME | NAME)",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Approve a certificate signing request"),
|
||||
Long: templates.LongDesc(`
|
||||
Approve a certificate signing request.
|
||||
|
@ -119,6 +121,7 @@ func NewCmdCertificateDeny(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
options := CertificateOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "deny (-f FILENAME | NAME)",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Deny a certificate signing request"),
|
||||
Long: templates.LongDesc(`
|
||||
Deny a certificate signing request.
|
||||
|
|
|
@ -98,6 +98,7 @@ func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "completion SHELL",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Output shell completion code for the specified shell (bash or zsh)"),
|
||||
Long: completion_long,
|
||||
Example: completion_example,
|
||||
|
|
|
@ -38,6 +38,7 @@ func NewCmdConfig(f cmdutil.Factory, pathOptions *clientcmd.PathOptions, out, er
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "config SUBCOMMAND",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Modify kubeconfig files"),
|
||||
Long: templates.LongDesc(`
|
||||
Modify kubeconfig files using subcommands like "kubectl config set current-context my-context"
|
||||
|
|
|
@ -101,6 +101,7 @@ func NewCmdConfigSetAuthInfo(out io.Writer, configAccess clientcmd.ConfigAccess)
|
|||
func newCmdConfigSetAuthInfo(out io.Writer, options *createAuthInfoOptions) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: fmt.Sprintf("set-credentials NAME [--%v=path/to/certfile] [--%v=path/to/keyfile] [--%v=bearer_token] [--%v=basic_user] [--%v=basic_password] [--%v=provider_name] [--%v=key=value]", clientcmd.FlagCertFile, clientcmd.FlagKeyFile, clientcmd.FlagBearerToken, clientcmd.FlagUsername, clientcmd.FlagPassword, flagAuthProvider, flagAuthProviderArg),
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Sets a user entry in kubeconfig"),
|
||||
Long: create_authinfo_long,
|
||||
Example: create_authinfo_example,
|
||||
|
|
|
@ -64,6 +64,7 @@ func NewCmdConfigSetCluster(out io.Writer, configAccess clientcmd.ConfigAccess)
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: fmt.Sprintf("set-cluster NAME [--%v=server] [--%v=path/to/certificate/authority] [--%v=true]", clientcmd.FlagAPIServer, clientcmd.FlagCAFile, clientcmd.FlagInsecure),
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Sets a cluster entry in kubeconfig"),
|
||||
Long: create_cluster_long,
|
||||
Example: create_cluster_example,
|
||||
|
|
|
@ -55,6 +55,7 @@ func NewCmdConfigSetContext(out io.Writer, configAccess clientcmd.ConfigAccess)
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: fmt.Sprintf("set-context NAME [--%v=cluster_nickname] [--%v=user_nickname] [--%v=namespace]", clientcmd.FlagClusterName, clientcmd.FlagAuthInfoName, clientcmd.FlagNamespace),
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Sets a context entry in kubeconfig"),
|
||||
Long: create_context_long,
|
||||
Example: create_context_example,
|
||||
|
|
|
@ -36,6 +36,7 @@ var (
|
|||
func NewCmdConfigDeleteCluster(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "delete-cluster NAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Delete the specified cluster from the kubeconfig"),
|
||||
Long: "Delete the specified cluster from the kubeconfig",
|
||||
Example: delete_cluster_example,
|
||||
|
|
|
@ -36,6 +36,7 @@ var (
|
|||
func NewCmdConfigDeleteContext(out, errOut io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "delete-context NAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Delete the specified context from the kubeconfig"),
|
||||
Long: "Delete the specified context from the kubeconfig",
|
||||
Example: delete_context_example,
|
||||
|
|
|
@ -62,6 +62,7 @@ func NewCmdConfigGetContexts(out io.Writer, configAccess clientcmd.ConfigAccess)
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "get-contexts [(-o|--output=)name)]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Describe one or many contexts"),
|
||||
Long: getContextsLong,
|
||||
Example: getContextsExample,
|
||||
|
|
|
@ -62,6 +62,7 @@ func NewCmdConfigRenameContext(out io.Writer, configAccess clientcmd.ConfigAcces
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: renameContextUse,
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: renameContextShort,
|
||||
Long: renameContextLong,
|
||||
Example: renameContextExample,
|
||||
|
|
|
@ -57,6 +57,7 @@ func NewCmdConfigSet(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "set PROPERTY_NAME PROPERTY_VALUE",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Sets an individual value in a kubeconfig file"),
|
||||
Long: set_long,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
|
|
@ -45,6 +45,7 @@ func NewCmdConfigUnset(out io.Writer, configAccess clientcmd.ConfigAccess) *cobr
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "unset PROPERTY_NAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Unsets an individual value in a kubeconfig file"),
|
||||
Long: unset_long,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
|
|
@ -46,6 +46,7 @@ func NewCmdConfigUseContext(out io.Writer, configAccess clientcmd.ConfigAccess)
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "use-context CONTEXT_NAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Sets the current-context in a kubeconfig file"),
|
||||
Aliases: []string{"use"},
|
||||
Long: `Sets the current-context in a kubeconfig file`,
|
||||
|
|
|
@ -66,6 +66,7 @@ func NewCmdConvert(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "convert -f FILENAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Convert config files between different API versions"),
|
||||
Long: convert_long,
|
||||
Example: convert_example,
|
||||
|
|
|
@ -65,6 +65,7 @@ var (
|
|||
func NewCmdCp(f cmdutil.Factory, cmdOut, cmdErr io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "cp <file-spec-src> <file-spec-dest>",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Copy files and directories to and from containers."),
|
||||
Long: "Copy files and directories to and from containers.",
|
||||
Example: cpExample,
|
||||
|
|
|
@ -66,6 +66,7 @@ func NewCmdCreate(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "create -f FILENAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create a resource from a file or from stdin."),
|
||||
Long: createLong,
|
||||
Example: createExample,
|
||||
|
|
|
@ -67,6 +67,7 @@ func NewCmdCreateClusterRole(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command
|
|||
}
|
||||
cmd := &cobra.Command{
|
||||
Use: "clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: clusterRoleLong,
|
||||
Long: clusterRoleLong,
|
||||
Example: clusterRoleExample,
|
||||
|
|
|
@ -40,6 +40,7 @@ var (
|
|||
func NewCmdCreateClusterRoleBinding(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "clusterrolebinding NAME --clusterrole=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create a ClusterRoleBinding for a particular ClusterRole"),
|
||||
Long: clusterRoleBindingLong,
|
||||
Example: clusterRoleBindingExample,
|
||||
|
|
|
@ -61,6 +61,7 @@ var (
|
|||
func NewCmdCreateConfigMap(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Aliases: []string{"cm"},
|
||||
Short: i18n.T("Create a configmap from a local file, directory or literal value"),
|
||||
Long: configMapLong,
|
||||
|
|
|
@ -42,6 +42,7 @@ var (
|
|||
func NewCmdCreateDeployment(f cmdutil.Factory, cmdOut, cmdErr io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "deployment NAME --image=image [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Aliases: []string{"deploy"},
|
||||
Short: i18n.T("Create a deployment with the specified name."),
|
||||
Long: deploymentLong,
|
||||
|
|
|
@ -40,6 +40,7 @@ var (
|
|||
func NewCmdCreateNamespace(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "namespace NAME [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Aliases: []string{"ns"},
|
||||
Short: i18n.T("Create a namespace with the specified name"),
|
||||
Long: namespaceLong,
|
||||
|
|
|
@ -45,6 +45,7 @@ var (
|
|||
func NewCmdCreatePodDisruptionBudget(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "poddisruptionbudget NAME --selector=SELECTOR --min-available=N [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Aliases: []string{"pdb"},
|
||||
Short: i18n.T("Create a pod disruption budget with the specified name."),
|
||||
Long: pdbLong,
|
||||
|
|
|
@ -43,6 +43,7 @@ var (
|
|||
func NewCmdCreatePriorityClass(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "priorityclass NAME --value=VALUE --global-default=BOOL [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Aliases: []string{"pc"},
|
||||
Short: i18n.T("Create a priorityclass with the specified name."),
|
||||
Long: pcLong,
|
||||
|
|
|
@ -43,6 +43,7 @@ var (
|
|||
func NewCmdCreateQuota(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "quota NAME [--hard=key1=value1,key2=value2] [--scopes=Scope1,Scope2] [--dry-run=bool]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Aliases: []string{"resourcequota"},
|
||||
Short: i18n.T("Create a quota with the specified name."),
|
||||
Long: quotaLong,
|
||||
|
|
|
@ -122,6 +122,7 @@ func NewCmdCreateRole(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
|||
}
|
||||
cmd := &cobra.Command{
|
||||
Use: "role NAME --verb=verb --resource=resource.group/subresource [--resource-name=resourcename] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: roleLong,
|
||||
Long: roleLong,
|
||||
Example: roleExample,
|
||||
|
|
|
@ -40,6 +40,7 @@ var (
|
|||
func NewCmdCreateRoleBinding(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "rolebinding NAME --clusterrole=NAME|--role=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create a RoleBinding for a particular Role or ClusterRole"),
|
||||
Long: roleBindingLong,
|
||||
Example: roleBindingExample,
|
||||
|
|
|
@ -77,6 +77,7 @@ var (
|
|||
func NewCmdCreateSecretGeneric(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "generic NAME [--type=string] [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create a secret from a local file, directory or literal value"),
|
||||
Long: secretLong,
|
||||
Example: secretExample,
|
||||
|
@ -150,6 +151,7 @@ var (
|
|||
func NewCmdCreateSecretDockerRegistry(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "docker-registry NAME --docker-username=user --docker-password=password --docker-email=email [--docker-server=string] [--from-literal=key1=value1] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create a secret for use with a Docker registry"),
|
||||
Long: secretForDockerRegistryLong,
|
||||
Example: secretForDockerRegistryExample,
|
||||
|
@ -224,6 +226,7 @@ var (
|
|||
func NewCmdCreateSecretTLS(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "tls NAME --cert=path/to/cert/file --key=path/to/key/file [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create a TLS secret"),
|
||||
Long: secretForTLSLong,
|
||||
Example: secretForTLSExample,
|
||||
|
|
|
@ -65,6 +65,7 @@ func addPortFlags(cmd *cobra.Command) {
|
|||
func NewCmdCreateServiceClusterIP(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "clusterip NAME [--tcp=<port>:<targetPort>] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create a ClusterIP service."),
|
||||
Long: serviceClusterIPLong,
|
||||
Example: serviceClusterIPExample,
|
||||
|
@ -125,6 +126,7 @@ var (
|
|||
func NewCmdCreateServiceNodePort(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "nodeport NAME [--tcp=port:targetPort] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create a NodePort service."),
|
||||
Long: serviceNodePortLong,
|
||||
Example: serviceNodePortExample,
|
||||
|
@ -182,6 +184,7 @@ var (
|
|||
func NewCmdCreateServiceLoadBalancer(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "loadbalancer NAME [--tcp=port:targetPort] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create a LoadBalancer service."),
|
||||
Long: serviceLoadBalancerLong,
|
||||
Example: serviceLoadBalancerExample,
|
||||
|
@ -241,6 +244,7 @@ var (
|
|||
func NewCmdCreateServiceExternalName(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "externalname NAME --external-name external.name [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Create an ExternalName service."),
|
||||
Long: serviceExternalNameLong,
|
||||
Example: serviceExternalNameExample,
|
||||
|
|
|
@ -40,6 +40,7 @@ var (
|
|||
func NewCmdCreateServiceAccount(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "serviceaccount NAME [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Aliases: []string{"sa"},
|
||||
Short: i18n.T("Create a service account with the specified name"),
|
||||
Long: serviceAccountLong,
|
||||
|
|
|
@ -128,6 +128,7 @@ func NewCmdDelete(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Delete resources by filenames, stdin, resources and names, or by resources and label selector"),
|
||||
Long: delete_long,
|
||||
Example: delete_example,
|
||||
|
|
|
@ -44,6 +44,7 @@ var unstructuredSerializer = dynamic.ContentConfig().NegotiatedSerializer
|
|||
|
||||
var fakecmd = &cobra.Command{
|
||||
Use: "delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])",
|
||||
DisableFlagsInUseLine: true,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cmdutil.CheckErr(cmdutil.ValidateOutputArgs(cmd))
|
||||
},
|
||||
|
|
|
@ -80,6 +80,7 @@ func NewCmdDescribe(f cmdutil.Factory, out, cmdErr io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Show details of a specific resource or group of resources"),
|
||||
Long: describeLong + "\n\n" + cmdutil.ValidResourceTypeList(f),
|
||||
Example: describeExample,
|
||||
|
|
|
@ -20,6 +20,7 @@ import (
|
|||
"bytes"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"k8s.io/client-go/rest/fake"
|
||||
|
@ -168,3 +169,30 @@ func TestDescribeObjectSkipEvents(t *testing.T) {
|
|||
t.Errorf("ShowEvents = false expected, got ShowEvents = %v", d.Settings.ShowEvents)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDescribeHelpMessage(t *testing.T) {
|
||||
f, _, _, _ := cmdtesting.NewAPIFactory()
|
||||
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
buferr := bytes.NewBuffer([]byte{})
|
||||
cmd := NewCmdDescribe(f, buf, buferr)
|
||||
cmd.SetArgs([]string{"-h"})
|
||||
cmd.SetOutput(buf)
|
||||
_, err := cmd.ExecuteC()
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
|
||||
got := buf.String()
|
||||
|
||||
expected := `describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)`
|
||||
if !strings.Contains(got, expected) {
|
||||
t.Errorf("Expected to contain: \n %v\nGot:\n %v\n", expected, got)
|
||||
}
|
||||
|
||||
unexpected := `describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME) [flags]`
|
||||
if strings.Contains(got, unexpected) {
|
||||
t.Errorf("Expected not to contain: \n %v\nGot:\n %v\n", unexpected, got)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,6 +110,7 @@ func NewCmdDiff(f cmdutil.Factory, stdout, stderr io.Writer) *cobra.Command {
|
|||
}
|
||||
cmd := &cobra.Command{
|
||||
Use: "diff -f FILENAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Diff different versions of configurations"),
|
||||
Long: diffLong,
|
||||
Example: diffExample,
|
||||
|
|
|
@ -106,6 +106,7 @@ func NewCmdCordon(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "cordon NODE",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Mark node as unschedulable"),
|
||||
Long: cordon_long,
|
||||
Example: cordon_example,
|
||||
|
@ -133,6 +134,7 @@ func NewCmdUncordon(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "uncordon NODE",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Mark node as schedulable"),
|
||||
Long: uncordon_long,
|
||||
Example: uncordon_example,
|
||||
|
@ -185,6 +187,7 @@ func NewCmdDrain(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "drain NODE",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Drain node in preparation for maintenance"),
|
||||
Long: drain_long,
|
||||
Example: drain_example,
|
||||
|
|
|
@ -88,6 +88,7 @@ func NewCmdEdit(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "edit (RESOURCE/NAME | -f FILENAME)",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Edit a resource on the server"),
|
||||
Long: editLong,
|
||||
Example: fmt.Sprintf(editExample),
|
||||
|
|
|
@ -74,6 +74,7 @@ func NewCmdExec(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *c
|
|||
}
|
||||
cmd := &cobra.Command{
|
||||
Use: "exec POD [-c CONTAINER] -- COMMAND [args...]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Execute a command in a container"),
|
||||
Long: "Execute a command in a container.",
|
||||
Example: exec_example,
|
||||
|
|
|
@ -54,6 +54,7 @@ var (
|
|||
func NewCmdExplain(f cmdutil.Factory, out, cmdErr io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "explain RESOURCE",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Documentation of resources"),
|
||||
Long: explainLong + "\n\n" + cmdutil.ValidResourceTypeList(f),
|
||||
Example: explainExamples,
|
||||
|
|
|
@ -84,6 +84,7 @@ func NewCmdExposeService(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service"),
|
||||
Long: exposeLong,
|
||||
Example: exposeExample,
|
||||
|
|
|
@ -32,6 +32,7 @@ var helpLong = templates.LongDesc(i18n.T(`
|
|||
func NewCmdHelp() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "help [command] | STRING_TO_SEARCH",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Help about any command"),
|
||||
Long: helpLong,
|
||||
|
||||
|
|
|
@ -112,6 +112,7 @@ func NewCmdLabel(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Update the labels on a resource"),
|
||||
Long: fmt.Sprintf(labelLong, validation.LabelValueMaxLength),
|
||||
Example: labelExample,
|
||||
|
|
|
@ -90,6 +90,7 @@ func NewCmdLogs(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
o := &LogsOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Print the logs for a container in a pod"),
|
||||
Long: "Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.",
|
||||
Example: logsExample,
|
||||
|
|
|
@ -96,6 +96,7 @@ func NewCmdPatch(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "patch (-f FILENAME | TYPE NAME) -p PATCH",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Update field(s) of a resource using strategic merge patch"),
|
||||
Long: patchLong,
|
||||
Example: patchExample,
|
||||
|
|
|
@ -51,6 +51,7 @@ func NewCmdPlugin(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cobra.Co
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "plugin NAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Runs a command-line plugin"),
|
||||
Long: plugin_long,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
|
|
@ -71,6 +71,7 @@ func NewCmdPortForward(f cmdutil.Factory, cmdOut, cmdErr io.Writer) *cobra.Comma
|
|||
}
|
||||
cmd := &cobra.Command{
|
||||
Use: "port-forward POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Forward one or more local ports to a pod"),
|
||||
Long: "Forward one or more local ports to a pod.",
|
||||
Example: portforwardExample,
|
||||
|
|
|
@ -72,6 +72,7 @@ var (
|
|||
func NewCmdProxy(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "proxy [--port=PORT] [--www=static-dir] [--www-prefix=prefix] [--api-prefix=prefix]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Run a proxy to the Kubernetes API server"),
|
||||
Long: proxyLong,
|
||||
Example: proxyExample,
|
||||
|
|
|
@ -65,6 +65,7 @@ func NewCmdReplace(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "replace -f FILENAME",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Replace a resource by filename or stdin"),
|
||||
Long: replaceLong,
|
||||
Example: replaceExample,
|
||||
|
|
|
@ -140,6 +140,7 @@ func NewCmdGet(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Comman
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE [NAME | -l label] | TYPE/NAME ...) [flags]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Display one or many resources"),
|
||||
Long: getLong + "\n\n" + cmdutil.ValidResourceTypeList(f),
|
||||
Example: getExample,
|
||||
|
|
|
@ -80,6 +80,7 @@ func NewCmdRollingUpdate(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "rolling-update OLD_CONTROLLER_NAME ([NEW_CONTROLLER_NAME] --image=NEW_CONTAINER_IMAGE | -f NEW_CONTROLLER_SPEC)",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Perform a rolling update of the given ReplicationController"),
|
||||
Long: rollingUpdateLong,
|
||||
Example: rollingUpdateExample,
|
||||
|
@ -93,9 +94,7 @@ func NewCmdRollingUpdate(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
cmd.Flags().Duration("timeout", timeout, `Max time to wait for a replication controller to update before giving up. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".`)
|
||||
usage := "Filename or URL to file to use to create the new replication controller."
|
||||
kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage)
|
||||
cmd.MarkFlagRequired("filename")
|
||||
cmd.Flags().String("image", "", i18n.T("Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f"))
|
||||
cmd.MarkFlagRequired("image")
|
||||
cmd.Flags().String("deployment-label-key", "deployment", i18n.T("The key to use to differentiate between two different controllers, default 'deployment'. Only relevant when --image is specified, ignored otherwise"))
|
||||
cmd.Flags().String("container", "", i18n.T("Container name which will have its image upgraded. Only relevant when --image is specified, ignored otherwise. Required when using --image on a multi-container pod"))
|
||||
cmd.Flags().String("image-pull-policy", "", i18n.T("Explicit policy for when to pull container images. Required when --image is same as existing image, ignored otherwise."))
|
||||
|
|
|
@ -50,6 +50,7 @@ func NewCmdRollout(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "rollout SUBCOMMAND",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Manage the rollout of a resource"),
|
||||
Long: rollout_long,
|
||||
Example: rollout_example,
|
||||
|
|
|
@ -49,6 +49,7 @@ func NewCmdRolloutHistory(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "history (TYPE NAME | TYPE/NAME) [flags]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("View rollout history"),
|
||||
Long: history_long,
|
||||
Example: history_example,
|
||||
|
|
|
@ -72,6 +72,7 @@ func NewCmdRolloutPause(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "pause RESOURCE",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Mark the provided resource as paused"),
|
||||
Long: pause_long,
|
||||
Example: pause_example,
|
||||
|
|
|
@ -70,6 +70,7 @@ func NewCmdRolloutResume(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "resume RESOURCE",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Resume a paused resource"),
|
||||
Long: resume_long,
|
||||
Example: resume_example,
|
||||
|
|
|
@ -55,6 +55,7 @@ func NewCmdRolloutStatus(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "status (TYPE NAME | TYPE/NAME) [flags]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Show the status of the rollout"),
|
||||
Long: status_long,
|
||||
Example: status_example,
|
||||
|
|
|
@ -70,6 +70,7 @@ func NewCmdRolloutUndo(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "undo (TYPE NAME | TYPE/NAME) [flags]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Undo a previous rollout"),
|
||||
Long: undo_long,
|
||||
Example: undo_example,
|
||||
|
|
|
@ -97,6 +97,7 @@ type RunObject struct {
|
|||
func NewCmdRun(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "run NAME --image=image [--env=\"key=value\"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [--command] -- [COMMAND] [args...]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Run a particular image on the cluster"),
|
||||
Long: runLong,
|
||||
Example: runExample,
|
||||
|
|
|
@ -65,6 +65,7 @@ func NewCmdScale(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME)",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job"),
|
||||
Long: scaleLong,
|
||||
Example: scaleExample,
|
||||
|
|
|
@ -35,6 +35,7 @@ var (
|
|||
func NewCmdSet(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "set SUBCOMMAND",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Set specific features on objects"),
|
||||
Long: set_long,
|
||||
Run: cmdutil.DefaultSubCommandRun(err),
|
||||
|
|
|
@ -136,6 +136,7 @@ func NewCmdEnv(f cmdutil.Factory, in io.Reader, out, errout io.Writer) *cobra.Co
|
|||
}
|
||||
cmd := &cobra.Command{
|
||||
Use: "env RESOURCE/NAME KEY_1=VAL_1 ... KEY_N=VAL_N",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: "Update environment variables on a pod template",
|
||||
Long: envLong,
|
||||
Example: fmt.Sprintf(envExample),
|
||||
|
|
|
@ -93,6 +93,7 @@ func NewCmdImage(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Update image of a pod template"),
|
||||
Long: image_long,
|
||||
Example: image_example,
|
||||
|
|
|
@ -99,6 +99,7 @@ func NewCmdResources(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Update resource requests/limits on objects with pod templates"),
|
||||
Long: fmt.Sprintf(resources_long, strings.Join(resourceTypesWithPodTemplate, ", ")),
|
||||
Example: resources_example,
|
||||
|
|
|
@ -80,6 +80,7 @@ func NewCmdSelector(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Set the selector on a resource"),
|
||||
Long: fmt.Sprintf(selectorLong, validation.LabelValueMaxLength),
|
||||
Example: selectorExample,
|
||||
|
|
|
@ -84,6 +84,7 @@ func NewCmdServiceAccount(f cmdutil.Factory, out, err io.Writer) *cobra.Command
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "serviceaccount (-f FILENAME | TYPE NAME) SERVICE_ACCOUNT",
|
||||
DisableFlagsInUseLine: true,
|
||||
Aliases: []string{"sa"},
|
||||
Short: i18n.T("Update ServiceAccount of a resource"),
|
||||
Long: serviceaccountLong,
|
||||
|
|
|
@ -85,6 +85,7 @@ func NewCmdSubject(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Co
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "subject (-f FILENAME | TYPE NAME) [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBinding"),
|
||||
Long: subject_long,
|
||||
Example: subject_example,
|
||||
|
|
|
@ -86,6 +86,7 @@ func NewCmdTaint(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Update the taints on one or more nodes"),
|
||||
Long: fmt.Sprintf(taintLong, validation.DNS1123SubdomainMaxLength, validation.LabelValueMaxLength),
|
||||
Example: taintExample,
|
||||
|
|
|
@ -90,6 +90,7 @@ func NewCmdTopNode(f cmdutil.Factory, options *TopNodeOptions, out io.Writer) *c
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "node [NAME | -l label]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Display Resource (CPU/Memory/Storage) usage of nodes"),
|
||||
Long: topNodeLong,
|
||||
Example: topNodeExample,
|
||||
|
|
|
@ -79,6 +79,7 @@ func NewCmdTopPod(f cmdutil.Factory, options *TopPodOptions, out io.Writer) *cob
|
|||
|
||||
cmd := &cobra.Command{
|
||||
Use: "pod [NAME | -l label]",
|
||||
DisableFlagsInUseLine: true,
|
||||
Short: i18n.T("Display Resource (CPU/Memory/Storage) usage of pods"),
|
||||
Long: topPodLong,
|
||||
Example: topPodExample,
|
||||
|
|
Loading…
Reference in New Issue