spf13/cobra: don't use PersistentFlags() (#319)

This commit is contained in:
Nikolay Edigaryev
2025-05-26 19:58:37 +04:00
committed by GitHub
parent 3a05fc71ae
commit 76f0672759
12 changed files with 59 additions and 59 deletions
+6 -6
View File
@@ -42,17 +42,17 @@ func newCreateCommand() *cobra.Command {
RunE: runCreate,
}
command.PersistentFlags().StringVar(&contextName, "name", "default",
command.Flags().StringVar(&contextName, "name", "default",
"context name to use")
command.PersistentFlags().StringVar(&bootstrapTokenRaw, "bootstrap-token", "",
command.Flags().StringVar(&bootstrapTokenRaw, "bootstrap-token", "",
"bootstrap token to use")
command.PersistentFlags().StringVar(&serviceAccountName, "service-account-name", "",
command.Flags().StringVar(&serviceAccountName, "service-account-name", "",
"service account name to use (alternative to --bootstrap-token)")
command.PersistentFlags().StringVar(&serviceAccountToken, "service-account-token", "",
command.Flags().StringVar(&serviceAccountToken, "service-account-token", "",
"service account token to use (alternative to --bootstrap-token)")
command.PersistentFlags().BoolVar(&force, "force", false,
command.Flags().BoolVar(&force, "force", false,
"create the context even if a context with the same name already exists")
command.PersistentFlags().BoolVar(&noPKI, "no-pki", false,
command.Flags().BoolVar(&noPKI, "no-pki", false,
"do not use the host's root CA set and instead validate the Controller's presented "+
"certificate using a bootstrap token (or manually via fingerprint, "+
"if no bootstrap token is provided)")