Tolerate multiple registered versions in a single group

This commit is contained in:
Jordan Liggitt
2016-03-11 11:41:18 -05:00
parent c9250bba2a
commit d008283942
9 changed files with 30 additions and 16 deletions

View File

@@ -183,7 +183,7 @@ func DefaultGenerators(cmdName string) map[string]kubectl.Generator {
// if optionalClientConfig is nil, then flags will be bound to a new clientcmd.ClientConfig.
// if optionalClientConfig is not nil, then this factory will make use of it.
func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
mapper := kubectl.ShortcutExpander{RESTMapper: api.RESTMapper}
mapper := kubectl.ShortcutExpander{RESTMapper: registered.RESTMapper()}
flags := pflag.NewFlagSet("", pflag.ContinueOnError)
flags.SetNormalizeFunc(util.WarnWordSepNormalizeFunc) // Warn for "_" flags