mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #106739 from kebe7jun/feature/add-completion-for-set-context
Add completion for `kubectl config set-context`
This commit is contained in:
commit
2b32b4b352
@ -27,6 +27,7 @@ import (
|
||||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
||||
cliflag "k8s.io/component-base/cli/flag"
|
||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||
"k8s.io/kubectl/pkg/util"
|
||||
"k8s.io/kubectl/pkg/util/i18n"
|
||||
"k8s.io/kubectl/pkg/util/templates"
|
||||
)
|
||||
@ -61,6 +62,7 @@ func NewCmdConfigSetContext(out io.Writer, configAccess clientcmd.ConfigAccess)
|
||||
Short: i18n.T("Set a context entry in kubeconfig"),
|
||||
Long: createContextLong,
|
||||
Example: createContextExample,
|
||||
ValidArgsFunction: util.ContextCompletionFunc,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cmdutil.CheckErr(options.complete(cmd))
|
||||
name, exists, err := options.run()
|
||||
|
Loading…
Reference in New Issue
Block a user