Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark kubectl flags as hidden #19

Merged
merged 1 commit into from
Feb 20, 2024
Merged

mark kubectl flags as hidden #19

merged 1 commit into from
Feb 20, 2024

Conversation

bacongobbler
Copy link
Collaborator

@bacongobbler bacongobbler commented Feb 20, 2024

Other than --kubeconfig and --namespace, a large majority of the flags provided by k8s.io/cli-runtime rarely apply to the k8s plugin. To address this, I'm marking them as hidden, removing their shortflag versions, and placing a --kube- prefix in front of each option. That way these flags do not clash with any flags we introduce in the future, and they're still accessible by the user should the need arise in the future.

@bacongobbler
Copy link
Collaborator Author

New help output:

><> spin k8s help
Manage apps running on Kubernetes

Usage:
  k8s [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  connect     connect to spin app locally
  delete      Delete app
  deploy      deploy spin app
  get         Display detailed information about an app
  help        Help about any command
  list        List apps
  logs        print the logs for a SpinApp
  scaffold    scaffold SpinApp manifest
  version     Display version information

Flags:
  -h, --help                help for k8s
      --kubeconfig string   Path to the kubeconfig file to use for CLI requests.
  -n, --namespace string    If present, the namespace scope for this CLI request
  -v, --version             version for k8s

Use "k8s [command] --help" for more information about a command.

Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
@bacongobbler bacongobbler merged commit ff30521 into main Feb 20, 2024
1 check passed
@bacongobbler bacongobbler deleted the fix-1 branch February 20, 2024 22:39
@@ -45,7 +46,30 @@ func newRootCmd() *cobra.Command {
},
}

configFlags.AddFlags(rootCmd.Flags())
flagSet := pflag.NewFlagSet("kubectl", pflag.ExitOnError)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow !! TIL. Thanks @bacongobbler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubectl flags should be separated from spin k8s flags
2 participants