forbid unnamed context

This commit is contained in:
Di Xu
2017-12-04 14:39:05 +08:00
parent 050956b08e
commit 792a229936
4 changed files with 43 additions and 5 deletions

View File

@@ -88,7 +88,7 @@ func (o *useContextOptions) complete(cmd *cobra.Command) error {
func (o useContextOptions) validate(config *clientcmdapi.Config) error {
if len(o.contextName) == 0 {
return errors.New("you must specify a current-context")
return errors.New("empty context names are not allowed")
}
for name := range config.Contexts {