From a86380c7813a6d0cfa248c9165c878038730526a Mon Sep 17 00:00:00 2001 From: Andrea Hoffer Date: Mon, 12 Jun 2023 15:55:59 -0400 Subject: [PATCH] Update CLI help text for grammar and consistency --- staging/src/k8s.io/kubectl/pkg/cmd/apply/apply.go | 2 +- staging/src/k8s.io/kubectl/pkg/cmd/auth/auth.go | 2 +- .../kubectl/pkg/cmd/certificates/certificates.go | 6 +++--- .../k8s.io/kubectl/pkg/cmd/completion/completion.go | 4 ++-- staging/src/k8s.io/kubectl/pkg/cmd/config/config.go | 2 +- .../src/k8s.io/kubectl/pkg/cmd/config/set_cluster.go | 4 ++-- .../k8s.io/kubectl/pkg/cmd/config/set_credentials.go | 4 ++-- staging/src/k8s.io/kubectl/pkg/cmd/config/view.go | 2 +- .../k8s.io/kubectl/pkg/cmd/create/create_ingress.go | 2 +- .../kubectl/pkg/cmd/create/create_secret_docker.go | 2 +- .../k8s.io/kubectl/pkg/cmd/create/create_token.go | 2 +- staging/src/k8s.io/kubectl/pkg/cmd/delete/delete.go | 2 +- .../src/k8s.io/kubectl/pkg/cmd/describe/describe.go | 4 ++-- staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go | 4 ++-- staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go | 2 +- staging/src/k8s.io/kubectl/pkg/cmd/events/events.go | 12 ++++++------ staging/src/k8s.io/kubectl/pkg/cmd/get/get.go | 2 +- staging/src/k8s.io/kubectl/pkg/cmd/patch/patch.go | 4 ++-- .../src/k8s.io/kubectl/pkg/cmd/rollout/rollout.go | 2 +- staging/src/k8s.io/kubectl/pkg/cmd/scale/scale.go | 2 +- staging/src/k8s.io/kubectl/pkg/cmd/taint/taint.go | 2 +- staging/src/k8s.io/kubectl/pkg/cmd/top/top.go | 2 +- staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go | 4 ++-- 23 files changed, 37 insertions(+), 37 deletions(-) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/apply/apply.go b/staging/src/k8s.io/kubectl/pkg/cmd/apply/apply.go index 446e7e4cdfa..7263513acb3 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/apply/apply.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/apply/apply.go @@ -160,7 +160,7 @@ var ( # Apply the JSON passed into stdin to a pod cat pod.json | kubectl apply -f - - # Apply the configuration from all files that end with '.json' - i.e. expand wildcard characters in file names + # Apply the configuration from all files that end with '.json' kubectl apply -f '*.json' # Note: --prune is still in Alpha diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/auth/auth.go b/staging/src/k8s.io/kubectl/pkg/cmd/auth/auth.go index b22ee860411..504a1bc78b1 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/auth/auth.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/auth/auth.go @@ -29,7 +29,7 @@ func NewCmdAuth(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Co cmds := &cobra.Command{ Use: "auth", Short: "Inspect authorization", - Long: `Inspect authorization`, + Long: `Inspect authorization.`, Run: cmdutil.DefaultSubCommandRun(streams.ErrOut), } diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/certificates/certificates.go b/staging/src/k8s.io/kubectl/pkg/cmd/certificates/certificates.go index 82658c758ab..ca755a2eb79 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/certificates/certificates.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/certificates/certificates.go @@ -45,7 +45,7 @@ func NewCmdCertificate(restClientGetter genericclioptions.RESTClientGetter, ioSt cmd := &cobra.Command{ Use: "certificate SUBCOMMAND", DisableFlagsInUseLine: true, - Short: i18n.T("Modify certificate resources."), + Short: i18n.T("Modify certificate resources"), Long: i18n.T("Modify certificate resources."), Run: func(cmd *cobra.Command, args []string) { cmd.Help() @@ -132,7 +132,7 @@ func NewCmdCertificateApprove(restClientGetter genericclioptions.RESTClientGette kubectl certificate approve allows a cluster admin to approve a certificate signing request (CSR). This action tells a certificate signing controller to - issue a certificate to the requestor with the attributes requested in the CSR. + issue a certificate to the requester with the attributes requested in the CSR. SECURITY NOTICE: Depending on the requested attributes, the issued certificate can potentially grant a requester access to cluster resources or to authenticate @@ -180,7 +180,7 @@ func NewCmdCertificateDeny(restClientGetter genericclioptions.RESTClientGetter, kubectl certificate deny allows a cluster admin to deny a certificate signing request (CSR). This action tells a certificate signing controller to - not to issue a certificate to the requestor. + not to issue a certificate to the requester. `)), Example: templates.Examples(i18n.T(` # Deny CSR 'csr-sqgzp' diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/completion/completion.go b/staging/src/k8s.io/kubectl/pkg/cmd/completion/completion.go index f9f27fe662f..8656ad806da 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/completion/completion.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/completion/completion.go @@ -82,7 +82,7 @@ var ( ## Write bash completion code to a file and source it from .bash_profile kubectl completion bash > ~/.kube/completion.bash.inc printf " - # Kubectl shell completion + # kubectl shell completion source '$HOME/.kube/completion.bash.inc' " >> $HOME/.bash_profile source $HOME/.bash_profile @@ -95,7 +95,7 @@ var ( # Load the kubectl completion code for fish[2] into the current shell kubectl completion fish | source - # To load completions for each session, execute once: + # To load completions for each session, execute once: kubectl completion fish > ~/.config/fish/completions/kubectl.fish # Load the kubectl completion code for powershell into the current shell diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/config/config.go b/staging/src/k8s.io/kubectl/pkg/cmd/config/config.go index b84a3344aee..b8bbf8a7c94 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/config/config.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/config/config.go @@ -41,7 +41,7 @@ func NewCmdConfig(pathOptions *clientcmd.PathOptions, streams genericiooptions.I DisableFlagsInUseLine: true, Short: i18n.T("Modify kubeconfig files"), Long: templates.LongDesc(i18n.T(` - Modify kubeconfig files using subcommands like "kubectl config set current-context my-context" + Modify kubeconfig files using subcommands like "kubectl config set current-context my-context". The loading order follows these rules: diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/config/set_cluster.go b/staging/src/k8s.io/kubectl/pkg/cmd/config/set_cluster.go index 28930272c1c..18ad6bf5e04 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/config/set_cluster.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/config/set_cluster.go @@ -59,10 +59,10 @@ var ( # Disable cert checking for the e2e cluster entry kubectl config set-cluster e2e --insecure-skip-tls-verify=true - # Set custom TLS server name to use for validation for the e2e cluster entry + # Set the custom TLS server name to use for validation for the e2e cluster entry kubectl config set-cluster e2e --tls-server-name=my-cluster-name - # Set proxy url for the e2e cluster entry + # Set the proxy URL for the e2e cluster entry kubectl config set-cluster e2e --proxy-url=https://1.2.3.4`) ) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/config/set_credentials.go b/staging/src/k8s.io/kubectl/pkg/cmd/config/set_credentials.go index 182dadeddf3..5bfd1186b5d 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/config/set_credentials.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/config/set_credentials.go @@ -96,7 +96,7 @@ var ( # Enable the Google Compute Platform auth provider for the "cluster-admin" entry kubectl config set-credentials cluster-admin --auth-provider=gcp - # Enable the OpenID Connect auth provider for the "cluster-admin" entry with additional args + # Enable the OpenID Connect auth provider for the "cluster-admin" entry with additional arguments kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-id=foo --auth-provider-arg=client-secret=bar # Remove the "client-secret" config value for the OpenID Connect auth provider for the "cluster-admin" entry @@ -105,7 +105,7 @@ var ( # Enable new exec auth plugin for the "cluster-admin" entry kubectl config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1 - # Define new exec auth plugin args for the "cluster-admin" entry + # Define new exec auth plugin arguments for the "cluster-admin" entry kubectl config set-credentials cluster-admin --exec-arg=arg1 --exec-arg=arg2 # Create or update exec auth plugin environment variables for the "cluster-admin" entry diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/config/view.go b/staging/src/k8s.io/kubectl/pkg/cmd/config/view.go index 34adb7a6978..ec3a935988d 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/config/view.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/config/view.go @@ -61,7 +61,7 @@ var ( # Show merged kubeconfig settings kubectl config view - # Show merged kubeconfig settings and raw certificate data and exposed secrets + # Show merged kubeconfig settings, raw certificate data, and exposed secrets kubectl config view --raw # Get the password for the e2e user diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress.go index fe440006419..d71048cdcb9 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress.go @@ -63,7 +63,7 @@ var ( ingressExample = templates.Examples(i18n.T(` # Create a single ingress called 'simple' that directs requests to foo.com/bar to svc - # svc1:8080 with a tls secret "my-cert" + # svc1:8080 with a TLS secret "my-cert" kubectl create ingress simple --rule="foo.com/bar=svc1:8080,tls=my-cert" # Create a catch all ingress of "/path" pointing to service svc:port and Ingress Class as "otheringress" diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_secret_docker.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_secret_docker.go index 76084c529c2..d8acc90d4a9 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_secret_docker.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_secret_docker.go @@ -54,7 +54,7 @@ var ( by creating a dockercfg secret and attaching it to your service account.`)) secretForDockerRegistryExample = templates.Examples(i18n.T(` - # If you don't already have a .dockercfg file, you can create a dockercfg secret directly by using: + # If you do not already have a .dockercfg file, create a dockercfg secret directly kubectl create secret docker-registry my-secret --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL # Create a new secret named my-secret from ~/.docker/config.json diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_token.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_token.go index 57fe4504d3e..77a3dfc1290 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_token.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_token.go @@ -89,7 +89,7 @@ var ( # Request a token bound to an instance of a Secret object kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret - # Request a token bound to an instance of a Secret object with a specific uid + # Request a token bound to an instance of a Secret object with a specific UID kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret --bound-object-uid 0d4691ed-659b-4935-a832-355f77ee47cc `) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/delete/delete.go b/staging/src/k8s.io/kubectl/pkg/cmd/delete/delete.go index f4abf2d0172..6a7dd0f7e15 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/delete/delete.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/delete/delete.go @@ -84,7 +84,7 @@ var ( # Delete resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml kubectl delete -k dir - # Delete resources from all files that end with '.json' - i.e. expand wildcard characters in file names + # Delete resources from all files that end with '.json' kubectl delete -f '*.json' # Delete a pod based on the type and name in the JSON passed into stdin diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/describe/describe.go b/staging/src/k8s.io/kubectl/pkg/cmd/describe/describe.go index 88d87fb98d2..be5c1ce5fdc 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/describe/describe.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/describe/describe.go @@ -62,9 +62,9 @@ var ( kubectl describe pods # Describe pods by label name=myLabel - kubectl describe po -l name=myLabel + kubectl describe pods -l name=myLabel - # Describe all pods managed by the 'frontend' replication controller + # Describe all pods managed by the 'frontend' replication controller # (rc-created pods get the name of the rc as a prefix in the pod name) kubectl describe pods frontend`)) ) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go b/staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go index e61481e3257..5d9922c6fb0 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go @@ -138,10 +138,10 @@ var ( ![Workflow](https://kubernetes.io/images/docs/kubectl_drain.svg)`)) drainExample = templates.Examples(i18n.T(` - # Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set or stateful set on it + # Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set on it kubectl drain foo --force - # As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set or stateful set, and use a grace period of 15 minutes + # As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set, and use a grace period of 15 minutes kubectl drain foo --grace-period=900`)) ) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go b/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go index 39a3a70e4e0..2e9228324a4 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go @@ -70,7 +70,7 @@ var ( # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation kubectl edit deployment/mydeployment -o yaml --save-config - # Edit the deployment/mydeployment's status subresource + # Edit the 'status' subresource for the 'mydeployment' deployment kubectl edit deployment mydeployment --subresource='status'`)) ) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/events/events.go b/staging/src/k8s.io/kubectl/pkg/cmd/events/events.go index 30c9c611bcb..152d6316f0f 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/events/events.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/events/events.go @@ -49,26 +49,26 @@ import ( var ( eventsLong = templates.LongDesc(i18n.T(` - Display events + Display events. Prints a table of the most important information about events. You can request events for a namespace, for all namespace, or filtered to only those pertaining to a specified resource.`)) eventsExample = templates.Examples(i18n.T(` - # List recent events in the default namespace. + # List recent events in the default namespace kubectl events - # List recent events in all namespaces. + # List recent events in all namespaces kubectl events --all-namespaces - # List recent events for the specified pod, then wait for more events and list them as they arrive. + # List recent events for the specified pod, then wait for more events and list them as they arrive kubectl events --for pod/web-pod-13je7 --watch - # List recent events in given format. Supported ones, apart from default, are json and yaml. + # List recent events in YAML format kubectl events -oyaml - # List recent only events in given event types + # List recent only events of type 'Warning' or 'Normal' kubectl events --types=Warning,Normal`)) ) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/get/get.go b/staging/src/k8s.io/kubectl/pkg/cmd/get/get.go index 157271e6196..f16586994af 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/get/get.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/get/get.go @@ -131,7 +131,7 @@ var ( # List one or more resources by their type and names kubectl get rc/web service/frontend pods/web-pod-13je7 - # List status subresource for a single pod. + # List the 'status' subresource for a single pod kubectl get pod web-pod-13je7 --subresource status`)) ) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/patch/patch.go b/staging/src/k8s.io/kubectl/pkg/cmd/patch/patch.go index bdbcb9054bc..4e89710549a 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/patch/patch.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/patch/patch.go @@ -101,8 +101,8 @@ var ( # Update a container's image using a JSON patch with positional arrays kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]' - - # Update a deployment's replicas through the scale subresource using a merge patch. + + # Update a deployment's replicas through the 'scale' subresource using a merge patch kubectl patch deployment nginx-deployment --subresource='scale' --type='merge' -p '{"spec":{"replicas":2}}'`)) ) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/rollout/rollout.go b/staging/src/k8s.io/kubectl/pkg/cmd/rollout/rollout.go index 145950adfdd..2ecbe48297e 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/rollout/rollout.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/rollout/rollout.go @@ -41,7 +41,7 @@ var ( # Restart a deployment kubectl rollout restart deployment/abc - # Restart deployments with the app=nginx label + # Restart deployments with the 'app=nginx' label kubectl rollout restart deployment --selector=app=nginx`) rolloutValidResources = dedent.Dedent(` diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/scale/scale.go b/staging/src/k8s.io/kubectl/pkg/cmd/scale/scale.go index 70c2e5a0c28..f2a6a6b8d83 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/scale/scale.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/scale/scale.go @@ -58,7 +58,7 @@ var ( kubectl scale --current-replicas=2 --replicas=3 deployment/mysql # Scale multiple replication controllers - kubectl scale --replicas=5 rc/foo rc/bar rc/baz + kubectl scale --replicas=5 rc/example1 rc/example2 rc/example3 # Scale stateful set named 'web' to 3 kubectl scale --replicas=3 statefulset/web`)) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/taint/taint.go b/staging/src/k8s.io/kubectl/pkg/cmd/taint/taint.go index 36d83e3e0de..bca70fe3103 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/taint/taint.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/taint/taint.go @@ -89,7 +89,7 @@ var ( # Remove from node 'foo' all the taints with key 'dedicated' kubectl taint nodes foo dedicated- - # Add a taint with key 'dedicated' on nodes having label mylabel=X + # Add a taint with key 'dedicated' on nodes having label myLabel=X kubectl taint node -l myLabel=X dedicated=foo:PreferNoSchedule # Add to node 'foo' a taint with key 'bar' and no value diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/top/top.go b/staging/src/k8s.io/kubectl/pkg/cmd/top/top.go index 1e5abc105e9..9f7e284c51c 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/top/top.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/top/top.go @@ -37,7 +37,7 @@ var ( "v1beta1", } topLong = templates.LongDesc(i18n.T(` - Display Resource (CPU/Memory) usage. + Display resource (CPU/memory) usage. The top command allows you to see the resource consumption for nodes or pods. diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go b/staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go index 66fdabfc2ba..dbbbd66a961 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go @@ -68,10 +68,10 @@ var ( # Wait for the pod "busybox1" to contain the status condition of type "Ready" kubectl wait --for=condition=Ready pod/busybox1 - # The default value of status condition is true; you can wait for other targets after an equal delimiter (compared after Unicode simple case folding, which is a more general form of case-insensitivity): + # The default value of status condition is true; you can wait for other targets after an equal delimiter (compared after Unicode simple case folding, which is a more general form of case-insensitivity) kubectl wait --for=condition=Ready=false pod/busybox1 - # Wait for the pod "busybox1" to contain the status phase to be "Running". + # Wait for the pod "busybox1" to contain the status phase to be "Running" kubectl wait --for=jsonpath='{.status.phase}'=Running pod/busybox1 # Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command