Skip to content

Commit 9eb0747

Browse files
committed
Cleanup help messages
Signed-off-by: Adrian Orive <[email protected]>
1 parent bebd89c commit 9eb0747

File tree

11 files changed

+55
-60
lines changed

11 files changed

+55
-60
lines changed

pkg/cli/alpha.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Alpha subcommands are for unstable features.
4242
4343
- Alpha subcommands are exploratory and may be removed without warning.
4444
- No backwards compatibility is provided for any alpha subcommands.
45-
`),
45+
`),
4646
}
4747
for i := range alphaCommands {
4848
alpha.AddCommand(alphaCommands[i])

pkg/cli/alpha/config-gen/cmd.go

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ config-gen programatically generates configuration for a controller-runtime base
102102
project using the project source code (golang) and a KubebuilderConfigGen resource file.
103103
104104
This is an alternative to expressing configuration as a static set of kustomize patches
105-
in the "config" directory.
105+
in the "config" directory.
106106
107107
config-gen may be used as a standalone command run against a file, as a kustomize
108108
transformer plugin, or as a configuration function (e.g. kpt).
@@ -148,55 +148,55 @@ The KubebuilderConfigGen resource has the following fields:
148148
crds:
149149
# path to go module source directory provided to controller-gen libraries
150150
# optional -- defaults to '.'
151-
sourceDirectory: ./relative/path
151+
sourceDirectory: ./relative/path
152152
153-
# configure how the controller-manager is generated
153+
# configure how the controller-manager is generated
154154
controllerManager:
155-
# image to run
156-
image: my-org/my-project:v0.1.0
155+
# image to run
156+
image: my-org/my-project:v0.1.0
157157
158-
# if set, use component config for the controller-manager
159-
# optional
160-
componentConfig:
161-
# use component config
158+
# if set, use component config for the controller-manager
159+
# optional
160+
componentConfig:
161+
# use component config
162162
enable: true
163163
164-
# path to component config to put into a ConfigMap
165-
configFilepath: ./path/to/componentconfig.yaml
164+
# path to component config to put into a ConfigMap
165+
configFilepath: ./path/to/componentconfig.yaml
166166
167-
# configure how metrics are exposed
168-
metrics:
169-
# disable the auth proxy required for scraping metrics
167+
# configure how metrics are exposed
168+
metrics:
169+
# disable the auth proxy required for scraping metrics
170170
# disable: false
171171
172-
# generate prometheus ServiceMonitor resource
173-
enableServiceMonitor: true
172+
# generate prometheus ServiceMonitor resource
173+
enableServiceMonitor: true
174174
175175
# configure how webhooks are generated
176-
# optional -- defaults to not generating webhook configuration
176+
# optional -- defaults to not generating webhook configuration
177177
webhooks:
178-
# enable will cause webhook config to be generated
179-
enable: true
178+
# enable will cause webhook config to be generated
179+
enable: true
180180
181-
# configures crds which use conversion webhooks
181+
# configures crds which use conversion webhooks
182182
enableConversion:
183-
# key is the name of the CRD
183+
# key is the name of the CRD
184184
"bars.example.my.domain": true
185185
186186
# configures where to get the certificate used for webhooks
187-
# discriminated union
188-
certificateSource:
189-
# type of certificate source
190-
# one of ["certManager", "dev", "manual"] -- defaults to "manual"
191-
# certManager: certmanager is used to manage certificates -- requires CertManager to be installed
192-
# dev: certificate is generated and wired into resources
193-
# manual: no certificate is generated or wired into resources
187+
# discriminated union
188+
certificateSource:
189+
# type of certificate source
190+
# one of ["certManager", "dev", "manual"] -- defaults to "manual"
191+
# certManager: certmanager is used to manage certificates -- requires CertManager to be installed
192+
# dev: certificate is generated and wired into resources
193+
# manual: no certificate is generated or wired into resources
194194
type: "dev"
195195
196-
# options for a dev certificate -- requires "dev" as the type
197-
devCertificate:
198-
duration: 1h
199-
`)
196+
# options for a dev certificate -- requires "dev" as the type
197+
devCertificate:
198+
duration: 1h
199+
`)
200200
c.Example = strings.TrimSpace(`
201201
#
202202
# As command
@@ -209,7 +209,7 @@ apiVersion: kubebuilder.sigs.k8s.io/v1alpha1
209209
name: project
210210
spec:
211211
controllerManager
212-
image: org/project:v0.1.0
212+
image: org/project:v0.1.0
213213
EOF
214214
215215
# run the config generator
@@ -250,7 +250,7 @@ EOF
250250
251251
# generate configuration from kustomize
252252
kustomize build --enable-alpha-plugins .
253-
`)
253+
`)
254254

255255
dir, dirErr := getPluginDir()
256256
pluginFile := filepath.Join(dir, "KubebuilderConfigGen")
@@ -261,10 +261,10 @@ kustomize build --enable-alpha-plugins .
261261
Short: "Install config-gen as a kustomize plugin",
262262
Long: strings.TrimSpace(fmt.Sprintf(`
263263
Write a script to %s for kustomize to locate as a plugin.
264-
`, pluginFile)),
264+
`, pluginFile)),
265265
Example: strings.TrimSpace(`
266266
kubebuilder alpha config-gen install-as-plugin
267-
`),
267+
`),
268268
RunE: func(cmd *cobra.Command, args []string) error {
269269
if dirErr != nil {
270270
return dirErr

pkg/cli/completion.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ func (c CLI) newFishCmd() *cobra.Command {
6969
$ %[1]s completion fish | source
7070
7171
# To load completions for each session, execute once:
72-
$ %[1]s completion fish > ~/.config/fish/completions/%[1]s.fish`, c.commandName),
72+
$ %[1]s completion fish > ~/.config/fish/completions/%[1]s.fish
73+
`, c.commandName),
7374
RunE: func(cmd *cobra.Command, cmdArgs []string) error {
7475
return cmd.Root().GenFishCompletion(os.Stdout, true)
7576
},

pkg/plugins/golang/v2/api.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ After the scaffold is written, api will run make on the project.
8888
8989
# Regenerate code and run against the Kubernetes cluster configured by ~/.kube/config
9090
make run
91-
`,
92-
ctx.CommandName)
91+
`, ctx.CommandName)
9392
}
9493

9594
func (p *createAPISubcommand) BindFlags(fs *pflag.FlagSet) {

pkg/plugins/golang/v2/edit.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ func (p *editSubcommand) UpdateContext(ctx *plugin.Context) {
4343
ctx.Description = `This command will edit the project configuration. You can have single or multi group project.`
4444

4545
ctx.Examples = fmt.Sprintf(`# Enable the multigroup layout
46-
%s edit --multigroup
46+
%[1]s edit --multigroup
4747
4848
# Disable the multigroup layout
49-
%s edit --multigroup=false
50-
`, ctx.CommandName, ctx.CommandName)
49+
%[1]s edit --multigroup=false
50+
`, ctx.CommandName)
5151
}
5252

5353
func (p *editSubcommand) BindFlags(fs *pflag.FlagSet) {

pkg/plugins/golang/v2/init.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ Writes the following files:
7575
`
7676
ctx.Examples = fmt.Sprintf(` # Scaffold a project using the apache2 license with "The Kubernetes authors" as owners
7777
%s init --project-version=2 --domain example.org --license apache2 --owner "The Kubernetes authors"
78-
`,
79-
ctx.CommandName)
78+
`, ctx.CommandName)
8079

8180
p.commandName = ctx.CommandName
8281
}

pkg/plugins/golang/v2/webhook.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ validating and (or) conversion webhooks.
5151
`
5252
ctx.Examples = fmt.Sprintf(` # Create defaulting and validating webhooks for CRD of group ship, version v1beta1
5353
# and kind Frigate.
54-
%s create webhook --group ship --version v1beta1 --kind Frigate --defaulting --programmatic-validation
54+
%[1]s create webhook --group ship --version v1beta1 --kind Frigate --defaulting --programmatic-validation
5555
5656
# Create conversion webhook for CRD of group shio, version v1beta1 and kind Frigate.
57-
%s create webhook --group ship --version v1beta1 --kind Frigate --conversion
58-
`,
59-
ctx.CommandName, ctx.CommandName)
57+
%[1]s create webhook --group ship --version v1beta1 --kind Frigate --conversion
58+
`, ctx.CommandName)
6059

6160
p.commandName = ctx.CommandName
6261
}

pkg/plugins/golang/v3/api.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ After the scaffold is written, api will run make on the project.
102102
103103
# Regenerate code and run against the Kubernetes cluster configured by ~/.kube/config
104104
make run
105-
`,
106-
ctx.CommandName)
105+
`, ctx.CommandName)
107106
}
108107

109108
func (p *createAPISubcommand) BindFlags(fs *pflag.FlagSet) {

pkg/plugins/golang/v3/edit.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ func (p *editSubcommand) UpdateContext(ctx *plugin.Context) {
4343
ctx.Description = `This command will edit the project configuration. You can have single or multi group project.`
4444

4545
ctx.Examples = fmt.Sprintf(`# Enable the multigroup layout
46-
%s edit --multigroup
46+
%[1]s edit --multigroup
4747
4848
# Disable the multigroup layout
49-
%s edit --multigroup=false
50-
`, ctx.CommandName, ctx.CommandName)
49+
%[1]s edit --multigroup=false
50+
`, ctx.CommandName)
5151
}
5252

5353
func (p *editSubcommand) BindFlags(fs *pflag.FlagSet) {

pkg/plugins/golang/v3/init.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ Writes the following files:
7474
`
7575
ctx.Examples = fmt.Sprintf(` # Scaffold a project using the apache2 license with "The Kubernetes authors" as owners
7676
%s init --project-version=2 --domain example.org --license apache2 --owner "The Kubernetes authors"
77-
`,
78-
ctx.CommandName)
77+
`, ctx.CommandName)
7978

8079
p.commandName = ctx.CommandName
8180
}

0 commit comments

Comments
 (0)