Merge pull request #18442 from deads2k/gv-restmapper-10

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot
2015-12-17 06:06:43 -08:00
21 changed files with 699 additions and 135 deletions

View File

@@ -175,16 +175,12 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
return clients.ClientConfigForVersion(nil)
},
RESTClient: func(mapping *meta.RESTMapping) (resource.RESTClient, error) {
gvk, err := api.RESTMapper.KindFor(mapping.Resource)
if err != nil {
return nil, err
}
mappingVersion := mapping.GroupVersionKind.GroupVersion()
client, err := clients.ClientForVersion(&mappingVersion)
if err != nil {
return nil, err
}
switch gvk.Group {
switch mapping.GroupVersionKind.Group {
case api.GroupName:
return client.RESTClient, nil
case extensions.GroupName: