Skip to content

Commit a404238

Browse files
authored
Merge pull request kubernetes#76638 from SataQiu/clean-command-kubeadm-20190416
[kubeadm] clean up command description information for consistency and readability
2 parents 9746a40 + 3949ee0 commit a404238

25 files changed

+93
-93
lines changed

cmd/kubeadm/app/cmd/alpha/certs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ import (
3434

3535
var (
3636
genericLongDesc = normalizer.LongDesc(`
37-
Renews the %[1]s, and saves them into %[2]s.cert and %[2]s.key files.
37+
Renew the %[1]s, and save them into %[2]s.cert and %[2]s.key files.
3838
3939
Extra attributes such as SANs will be based on the existing certificates, there is no need to resupply them.
4040
`)
4141
allLongDesc = normalizer.LongDesc(`
42-
Renews all known certificates necessary to run the control plane. Renewals are run unconditionally, regardless
42+
Renew all known certificates necessary to run the control plane. Renewals are run unconditionally, regardless
4343
of expiration date. Renewals can also be run individually for more control.
4444
`)
4545
)
@@ -60,7 +60,7 @@ func newCmdCertsUtility() *cobra.Command {
6060
func newCmdCertsRenewal() *cobra.Command {
6161
cmd := &cobra.Command{
6262
Use: "renew",
63-
Short: "Renews certificates for a Kubernetes cluster",
63+
Short: "Renew certificates for a Kubernetes cluster",
6464
Long: cmdutil.MacroCommandLongDescription,
6565
RunE: cmdutil.SubCmdRunE("renew"),
6666
}
@@ -107,7 +107,7 @@ func getRenewSubCommands() []*cobra.Command {
107107

108108
allCmd := &cobra.Command{
109109
Use: "all",
110-
Short: "renew all available certificates",
110+
Short: "Renew all available certificates",
111111
Long: allLongDesc,
112112
Run: func(*cobra.Command, []string) {
113113
for _, f := range funcList {
@@ -156,7 +156,7 @@ func generateRenewalFunction(cert *certsphase.KubeadmCert, caCert *certsphase.Ku
156156
func generateRenewalCommand(cert *certsphase.KubeadmCert, cfg *renewConfig) *cobra.Command {
157157
cmd := &cobra.Command{
158158
Use: cert.Name,
159-
Short: fmt.Sprintf("Generates the %s", cert.LongName),
159+
Short: fmt.Sprintf("Generate the %s", cert.LongName),
160160
Long: fmt.Sprintf(genericLongDesc, cert.LongName, cert.BaseName),
161161
}
162162
addFlags(cmd, cfg)

cmd/kubeadm/app/cmd/alpha/kubeconfig.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ var (
3737
` + cmdutil.AlphaDisclaimer)
3838

3939
userKubeconfigLongDesc = normalizer.LongDesc(`
40-
Outputs a kubeconfig file for an additional user.
40+
Output a kubeconfig file for an additional user.
4141
` + cmdutil.AlphaDisclaimer)
4242

4343
userKubeconfigExample = normalizer.Examples(`
44-
# Outputs a kubeconfig file for an additional user named foo
44+
# Output a kubeconfig file for an additional user named foo
4545
kubeadm alpha kubeconfig user --client-name=foo
4646
`)
4747
)
@@ -72,7 +72,7 @@ func newCmdUserKubeConfig(out io.Writer) *cobra.Command {
7272
// Creates the UX Command
7373
cmd := &cobra.Command{
7474
Use: "user",
75-
Short: "Outputs a kubeconfig file for an additional user",
75+
Short: "Output a kubeconfig file for an additional user",
7676
Long: userKubeconfigLongDesc,
7777
Example: userKubeconfigExample,
7878
Run: func(cmd *cobra.Command, args []string) {

cmd/kubeadm/app/cmd/alpha/kubelet.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@ import (
3535

3636
var (
3737
kubeletConfigDownloadLongDesc = normalizer.LongDesc(`
38-
Downloads the kubelet configuration from a ConfigMap of the form "kubelet-config-1.X" in the cluster,
38+
Download the kubelet configuration from a ConfigMap of the form "kubelet-config-1.X" in the cluster,
3939
where X is the minor version of the kubelet. Either kubeadm autodetects the kubelet version by exec-ing
4040
"kubelet --version" or respects the --kubelet-version parameter.
4141
` + cmdutil.AlphaDisclaimer)
4242

4343
kubeletConfigDownloadExample = normalizer.Examples(fmt.Sprintf(`
44-
# Downloads the kubelet configuration from the ConfigMap in the cluster. Autodetects the kubelet version.
44+
# Download the kubelet configuration from the ConfigMap in the cluster. Autodetect the kubelet version.
4545
kubeadm alpha phase kubelet config download
4646
47-
# Downloads the kubelet configuration from the ConfigMap in the cluster. Uses a specific desired kubelet version.
47+
# Download the kubelet configuration from the ConfigMap in the cluster. Use a specific desired kubelet version.
4848
kubeadm alpha phase kubelet config download --kubelet-version %s
4949
`, constants.CurrentKubernetesVersion))
5050

5151
kubeletConfigEnableDynamicLongDesc = normalizer.LongDesc(`
52-
Enables or updates dynamic kubelet configuration for a Node, against the kubelet-config-1.X ConfigMap in the cluster,
52+
Enable or update dynamic kubelet configuration for a Node, against the kubelet-config-1.X ConfigMap in the cluster,
5353
where X is the minor version of the desired kubelet version.
5454
5555
WARNING: This feature is still experimental, and disabled by default. Enable only if you know what you are doing, as it
@@ -58,7 +58,7 @@ var (
5858
` + cmdutil.AlphaDisclaimer)
5959

6060
kubeletConfigEnableDynamicExample = normalizer.Examples(fmt.Sprintf(`
61-
# Enables dynamic kubelet configuration for a Node.
61+
# Enable dynamic kubelet configuration for a Node.
6262
kubeadm alpha phase kubelet enable-dynamic-config --node-name node-1 --kubelet-version %s
6363
6464
WARNING: This feature is still experimental, and disabled by default. Enable only if you know what you are doing, as it
@@ -99,7 +99,7 @@ func newCmdKubeletConfigDownload() *cobra.Command {
9999

100100
cmd := &cobra.Command{
101101
Use: "download",
102-
Short: "Downloads the kubelet configuration from the cluster ConfigMap kubelet-config-1.X, where X is the minor version of the kubelet.",
102+
Short: "Download the kubelet configuration from the cluster ConfigMap kubelet-config-1.X, where X is the minor version of the kubelet",
103103
Long: kubeletConfigDownloadLongDesc,
104104
Example: kubeletConfigDownloadExample,
105105
Run: func(cmd *cobra.Command, args []string) {
@@ -134,7 +134,7 @@ func newCmdKubeletConfigEnableDynamic() *cobra.Command {
134134

135135
cmd := &cobra.Command{
136136
Use: "enable-dynamic",
137-
Short: "EXPERIMENTAL: Enables or updates dynamic kubelet configuration for a Node",
137+
Short: "EXPERIMENTAL: Enable or update dynamic kubelet configuration for a Node",
138138
Long: kubeletConfigEnableDynamicLongDesc,
139139
Example: kubeletConfigEnableDynamicExample,
140140
Run: func(cmd *cobra.Command, args []string) {

cmd/kubeadm/app/cmd/alpha/selfhosting.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ import (
4646

4747
var (
4848
selfhostingLongDesc = normalizer.LongDesc(`
49-
Converts static Pod files for control plane components into self-hosted DaemonSets configured via the Kubernetes API.
49+
Convert static Pod files for control plane components into self-hosted DaemonSets configured via the Kubernetes API.
5050
5151
See the documentation for self-hosting limitations.
5252
5353
` + cmdutil.AlphaDisclaimer)
5454

5555
selfhostingExample = normalizer.Examples(`
56-
# Converts a static Pod-hosted control plane into a self-hosted one.
56+
# Convert a static Pod-hosted control plane into a self-hosted one.
5757
5858
kubeadm alpha phase self-hosting convert-from-staticpods
5959
`)
@@ -64,7 +64,7 @@ func NewCmdSelfhosting(in io.Reader) *cobra.Command {
6464
cmd := &cobra.Command{
6565
Use: "selfhosting",
6666
Aliases: []string{"selfhosted", "self-hosting"},
67-
Short: "Makes a kubeadm cluster self-hosted",
67+
Short: "Make a kubeadm cluster self-hosted",
6868
Long: cmdutil.MacroCommandLongDescription,
6969
}
7070

@@ -86,7 +86,7 @@ func getSelfhostingSubCommand(in io.Reader) *cobra.Command {
8686
cmd := &cobra.Command{
8787
Use: "pivot",
8888
Aliases: []string{"from-staticpods"},
89-
Short: "Converts a static Pod-hosted control plane into a self-hosted one",
89+
Short: "Convert a static Pod-hosted control plane into a self-hosted one",
9090
Long: selfhostingLongDesc,
9191
Example: selfhostingExample,
9292
Run: func(cmd *cobra.Command, args []string) {

cmd/kubeadm/app/cmd/completion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func GetSupportedShells() []string {
102102
func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command {
103103
cmd := &cobra.Command{
104104
Use: "completion SHELL",
105-
Short: "Output shell completion code for the specified shell (bash or zsh).",
105+
Short: "Output shell completion code for the specified shell (bash or zsh)",
106106
Long: completionLong,
107107
Example: completionExample,
108108
Run: func(cmd *cobra.Command, args []string) {

cmd/kubeadm/app/cmd/config.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func NewCmdConfig(out io.Writer) *cobra.Command {
6464

6565
cmd := &cobra.Command{
6666
Use: "config",
67-
Short: "Manage configuration for a kubeadm cluster persisted in a ConfigMap in the cluster.",
67+
Short: "Manage configuration for a kubeadm cluster persisted in a ConfigMap in the cluster",
6868
Long: fmt.Sprintf(dedent.Dedent(`
6969
There is a ConfigMap in the %s namespace called %q that kubeadm uses to store internal configuration about the
7070
cluster. kubeadm CLI v1.8.0+ automatically creates this ConfigMap with the config used with 'kubeadm init', but if you
@@ -223,7 +223,7 @@ func NewCmdConfigMigrate(out io.Writer) *cobra.Command {
223223
var oldCfgPath, newCfgPath string
224224
cmd := &cobra.Command{
225225
Use: "migrate",
226-
Short: "Read an older version of the kubeadm configuration API types from a file, and output the similar config object for the newer version.",
226+
Short: "Read an older version of the kubeadm configuration API types from a file, and output the similar config object for the newer version",
227227
Long: fmt.Sprintf(dedent.Dedent(`
228228
This command lets you convert configuration objects of older versions to the latest supported version,
229229
locally in the CLI tool without ever touching anything in the cluster.
@@ -267,7 +267,7 @@ func NewCmdConfigMigrate(out io.Writer) *cobra.Command {
267267
func NewCmdConfigUpload(out io.Writer, kubeConfigFile *string) *cobra.Command {
268268
cmd := &cobra.Command{
269269
Use: "upload",
270-
Short: "Upload configuration about the current state, so that 'kubeadm upgrade' can later know how to configure the upgraded cluster.",
270+
Short: "Upload configuration about the current state, so that 'kubeadm upgrade' can later know how to configure the upgraded cluster",
271271
RunE: cmdutil.SubCmdRunE("upload"),
272272
}
273273

@@ -280,7 +280,7 @@ func NewCmdConfigUpload(out io.Writer, kubeConfigFile *string) *cobra.Command {
280280
func NewCmdConfigView(out io.Writer, kubeConfigFile *string) *cobra.Command {
281281
return &cobra.Command{
282282
Use: "view",
283-
Short: "View the kubeadm configuration stored inside the cluster.",
283+
Short: "View the kubeadm configuration stored inside the cluster",
284284
Long: fmt.Sprintf(dedent.Dedent(`
285285
Using this command, you can view the ConfigMap in the cluster where the configuration for kubeadm is located.
286286
@@ -303,7 +303,7 @@ func NewCmdConfigUploadFromFile(out io.Writer, kubeConfigFile *string) *cobra.Co
303303
var cfgPath string
304304
cmd := &cobra.Command{
305305
Use: "from-file",
306-
Short: "Upload a configuration file to the in-cluster ConfigMap for kubeadm configuration.",
306+
Short: "Upload a configuration file to the in-cluster ConfigMap for kubeadm configuration",
307307
Long: fmt.Sprintf(dedent.Dedent(`
308308
Using this command, you can upload configuration to the ConfigMap in the cluster using the same config file you gave to 'kubeadm init'.
309309
If you initialized your cluster using a v1.7.x or lower kubeadm client and used the --config option, you need to run this command with the
@@ -343,7 +343,7 @@ func NewCmdConfigUploadFromFlags(out io.Writer, kubeConfigFile *string) *cobra.C
343343

344344
cmd := &cobra.Command{
345345
Use: "from-flags",
346-
Short: "Create the in-cluster configuration file for the first time from using flags.",
346+
Short: "Create the in-cluster configuration file for the first time from using flags",
347347
Long: fmt.Sprintf(dedent.Dedent(`
348348
Using this command, you can upload configuration to the ConfigMap in the cluster using the same flags you gave to 'kubeadm init'.
349349
If you initialized your cluster using a v1.7.x or lower kubeadm client and set certain flags, you need to run this command with the
@@ -397,7 +397,7 @@ func RunConfigView(out io.Writer, client clientset.Interface) error {
397397
func NewCmdConfigImages(out io.Writer) *cobra.Command {
398398
cmd := &cobra.Command{
399399
Use: "images",
400-
Short: "Interact with container images used by kubeadm.",
400+
Short: "Interact with container images used by kubeadm",
401401
RunE: cmdutil.SubCmdRunE("images"),
402402
}
403403
cmd.AddCommand(NewCmdConfigImagesList(out, nil))
@@ -414,7 +414,7 @@ func NewCmdConfigImagesPull() *cobra.Command {
414414

415415
cmd := &cobra.Command{
416416
Use: "pull",
417-
Short: "Pull images used by kubeadm.",
417+
Short: "Pull images used by kubeadm",
418418
Run: func(_ *cobra.Command, _ []string) {
419419
externalcfg.ClusterConfiguration.FeatureGates, err = features.NewFeatureGate(&features.InitFeatureGates, featureGatesString)
420420
kubeadmutil.CheckErr(err)
@@ -472,7 +472,7 @@ func NewCmdConfigImagesList(out io.Writer, mockK8sVersion *string) *cobra.Comman
472472

473473
cmd := &cobra.Command{
474474
Use: "list",
475-
Short: "Print a list of images kubeadm will use. The configuration file is used in case any images or image repositories are customized.",
475+
Short: "Print a list of images kubeadm will use. The configuration file is used in case any images or image repositories are customized",
476476
Run: func(_ *cobra.Command, _ []string) {
477477
externalcfg.ClusterConfiguration.FeatureGates, err = features.NewFeatureGate(&features.InitFeatureGates, featureGatesString)
478478
kubeadmutil.CheckErr(err)

cmd/kubeadm/app/cmd/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func NewCmdInit(out io.Writer, initOptions *initOptions) *cobra.Command {
135135

136136
cmd := &cobra.Command{
137137
Use: "init",
138-
Short: "Run this command in order to set up the Kubernetes control plane.",
138+
Short: "Run this command in order to set up the Kubernetes control plane",
139139
Run: func(cmd *cobra.Command, args []string) {
140140
c, err := initRunner.InitData(args)
141141
kubeadmutil.CheckErr(err)

cmd/kubeadm/app/cmd/phases/init/addons.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,38 +31,38 @@ import (
3131

3232
var (
3333
coreDNSAddonLongDesc = normalizer.LongDesc(`
34-
Installs the CoreDNS addon components via the API server.
34+
Install the CoreDNS addon components via the API server.
3535
Please note that although the DNS server is deployed, it will not be scheduled until CNI is installed.
3636
`)
3737

3838
kubeProxyAddonLongDesc = normalizer.LongDesc(`
39-
Installs the kube-proxy addon components via the API server.
39+
Install the kube-proxy addon components via the API server.
4040
`)
4141
)
4242

4343
// NewAddonPhase returns the addon Cobra command
4444
func NewAddonPhase() workflow.Phase {
4545
return workflow.Phase{
4646
Name: "addon",
47-
Short: "Installs required addons for passing Conformance tests",
47+
Short: "Install required addons for passing Conformance tests",
4848
Long: cmdutil.MacroCommandLongDescription,
4949
Phases: []workflow.Phase{
5050
{
5151
Name: "all",
52-
Short: "Installs all the addons",
52+
Short: "Install all the addons",
5353
InheritFlags: getAddonPhaseFlags("all"),
5454
RunAllSiblings: true,
5555
},
5656
{
5757
Name: "coredns",
58-
Short: "Installs the CoreDNS addon to a Kubernetes cluster",
58+
Short: "Install the CoreDNS addon to a Kubernetes cluster",
5959
Long: coreDNSAddonLongDesc,
6060
InheritFlags: getAddonPhaseFlags("coredns"),
6161
Run: runCoreDNSAddon,
6262
},
6363
{
6464
Name: "kube-proxy",
65-
Short: "Installs the kube-proxy addon to a Kubernetes cluster",
65+
Short: "Install the kube-proxy addon to a Kubernetes cluster",
6666
Long: kubeProxyAddonLongDesc,
6767
InheritFlags: getAddonPhaseFlags("kube-proxy"),
6868
Run: runKubeProxyAddon,

cmd/kubeadm/app/cmd/phases/init/bootstraptoken.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var (
3838
`)
3939

4040
bootstrapTokenExamples = normalizer.Examples(`
41-
# Makes all the bootstrap token configurations and creates an initial token, functionally
41+
# Make all the bootstrap token configurations and create an initial token, functionally
4242
# equivalent to what generated by kubeadm init.
4343
kubeadm init phase bootstrap-token
4444
`)

cmd/kubeadm/app/cmd/phases/init/certs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ import (
3737

3838
var (
3939
saKeyLongDesc = fmt.Sprintf(normalizer.LongDesc(`
40-
Generates the private key for signing service account tokens along with its public key, and saves them into
40+
Generate the private key for signing service account tokens along with its public key, and save them into
4141
%s and %s files.
4242
If both files already exist, kubeadm skips the generation step and existing files will be used.
4343
`+cmdutil.AlphaDisclaimer), kubeadmconstants.ServiceAccountPrivateKeyName, kubeadmconstants.ServiceAccountPublicKeyName)
4444

4545
genericLongDesc = normalizer.LongDesc(`
46-
Generates the %[1]s, and saves them into %[2]s.cert and %[2]s.key files.%[3]s
46+
Generate the %[1]s, and save them into %[2]s.cert and %[2]s.key files.%[3]s
4747
4848
If both files already exist, kubeadm skips the generation step and existing files will be used.
4949
` + cmdutil.AlphaDisclaimer)
@@ -79,7 +79,7 @@ func newCertSubPhases() []workflow.Phase {
7979
// All subphase
8080
allPhase := workflow.Phase{
8181
Name: "all",
82-
Short: "Generates all certificates",
82+
Short: "Generate all certificates",
8383
InheritFlags: getCertPhaseFlags("all"),
8484
RunAllSiblings: true,
8585
}
@@ -102,7 +102,7 @@ func newCertSubPhases() []workflow.Phase {
102102
// SA creates the private/public key pair, which doesn't use x509 at all
103103
saPhase := workflow.Phase{
104104
Name: "sa",
105-
Short: "Generates a private key for signing service account tokens along with its public key",
105+
Short: "Generate a private key for signing service account tokens along with its public key",
106106
Long: saKeyLongDesc,
107107
Run: runCertsSa,
108108
InheritFlags: []string{options.CertificatesDir},
@@ -116,7 +116,7 @@ func newCertSubPhases() []workflow.Phase {
116116
func newCertSubPhase(certSpec *certsphase.KubeadmCert, run func(c workflow.RunData) error) workflow.Phase {
117117
phase := workflow.Phase{
118118
Name: certSpec.Name,
119-
Short: fmt.Sprintf("Generates the %s", certSpec.LongName),
119+
Short: fmt.Sprintf("Generate the %s", certSpec.LongName),
120120
Long: fmt.Sprintf(
121121
genericLongDesc,
122122
certSpec.LongName,

0 commit comments

Comments
 (0)