Merge pull request #18627 from caesarxuchao/oneline-fix

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot
2015-12-19 00:50:31 -08:00
2 changed files with 3 additions and 7 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: