Skip to content

Commit f4a76c7

Browse files
authored
Merge pull request #6258 from apricote/namespace-flag-shorthand-n
🌱 clusterctl: always use -n as the shorthand for --[target-]namespace
2 parents 239bafa + 96661ce commit f4a76c7

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

cmd/clusterctl/cmd/generate_provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func init() {
8282
"Bootstrap provider and version (e.g. kubeadm:v0.3.0)")
8383
generateProviderCmd.Flags().StringVarP(&gpo.controlPlaneProvider, "control-plane", "c", "",
8484
"ControlPlane provider and version (e.g. kubeadm:v0.3.0)")
85-
generateProviderCmd.Flags().StringVar(&gpo.targetNamespace, "target-namespace", "",
85+
generateProviderCmd.Flags().StringVarP(&gpo.targetNamespace, "target-namespace", "n", "",
8686
"The target namespace where the provider should be deployed. If unspecified, the components default namespace is used.")
8787
generateProviderCmd.Flags().BoolVar(&gpo.textOutput, "describe", false,
8888
"Generate configuration without variable substitution.")

cmd/clusterctl/cmd/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func init() {
102102
"Bootstrap providers and versions (e.g. kubeadm:v0.3.0) to add to the management cluster. If unspecified, Kubeadm bootstrap provider's latest release is used.")
103103
initCmd.Flags().StringSliceVarP(&initOpts.controlPlaneProviders, "control-plane", "c", nil,
104104
"Control plane providers and versions (e.g. kubeadm:v0.3.0) to add to the management cluster. If unspecified, the Kubeadm control plane provider's latest release is used.")
105-
initCmd.Flags().StringVar(&initOpts.targetNamespace, "target-namespace", "",
105+
initCmd.Flags().StringVarP(&initOpts.targetNamespace, "target-namespace", "n", "",
106106
"The target namespace where the providers should be deployed. If unspecified, the provider components' default namespace is used.")
107107
initCmd.Flags().BoolVar(&initOpts.waitProviders, "wait-providers", false,
108108
"Wait for providers to be installed.")

cmd/clusterctl/cmd/rollout/pause.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func NewCmdRolloutPause(cfgFile string) *cobra.Command {
6262
"Path to the kubeconfig file to use for accessing the management cluster. If unspecified, default discovery rules apply.")
6363
cmd.Flags().StringVar(&pauseOpt.kubeconfigContext, "kubeconfig-context", "",
6464
"Context to be used within the kubeconfig file. If empty, current context will be used.")
65-
cmd.Flags().StringVar(&pauseOpt.namespace, "namespace", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
65+
cmd.Flags().StringVarP(&pauseOpt.namespace, "namespace", "n", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
6666

6767
return cmd
6868
}

cmd/clusterctl/cmd/rollout/restart.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func NewCmdRolloutRestart(cfgFile string) *cobra.Command {
6060
"Path to the kubeconfig file to use for accessing the management cluster. If unspecified, default discovery rules apply.")
6161
cmd.Flags().StringVar(&restartOpt.kubeconfigContext, "kubeconfig-context", "",
6262
"Context to be used within the kubeconfig file. If empty, current context will be used.")
63-
cmd.Flags().StringVar(&restartOpt.namespace, "namespace", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
63+
cmd.Flags().StringVarP(&restartOpt.namespace, "namespace", "n", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
6464

6565
return cmd
6666
}

cmd/clusterctl/cmd/rollout/resume.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func NewCmdRolloutResume(cfgFile string) *cobra.Command {
6060
"Path to the kubeconfig file to use for accessing the management cluster. If unspecified, default discovery rules apply.")
6161
cmd.Flags().StringVar(&resumeOpt.kubeconfigContext, "kubeconfig-context", "",
6262
"Context to be used within the kubeconfig file. If empty, current context will be used.")
63-
cmd.Flags().StringVar(&resumeOpt.namespace, "namespace", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
63+
cmd.Flags().StringVarP(&resumeOpt.namespace, "namespace", "n", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
6464

6565
return cmd
6666
}

cmd/clusterctl/cmd/rollout/undo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func NewCmdRolloutUndo(cfgFile string) *cobra.Command {
6262
"Path to the kubeconfig file to use for accessing the management cluster. If unspecified, default discovery rules apply.")
6363
cmd.Flags().StringVar(&undoOpt.kubeconfigContext, "kubeconfig-context", "",
6464
"Context to be used within the kubeconfig file. If empty, current context will be used.")
65-
cmd.Flags().StringVar(&undoOpt.namespace, "namespace", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
65+
cmd.Flags().StringVarP(&undoOpt.namespace, "namespace", "n", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
6666
cmd.Flags().Int64Var(&undoOpt.toRevision, "to-revision", undoOpt.toRevision, "The revision to rollback to. Default to 0 (last revision).")
6767

6868
return cmd

0 commit comments

Comments
 (0)