make discovery static when extensions/thirdpartyresources is not enabled

This commit is contained in:
zhouhaibing089 2017-01-04 10:27:00 +08:00 committed by haibzhou
parent 9eaf1aa38f
commit a09fc73810

View File

@ -115,7 +115,7 @@ func startNamespaceController(ctx ControllerContext) (bool, error) {
return true, fmt.Errorf("failed to parse preferred server resources: %v", err)
}
discoverResourcesFn := namespaceKubeClient.Discovery().ServerPreferredNamespacedResources
if _, found := gvrs[extensions.SchemeGroupVersion.WithResource("thirdpartyresource")]; found {
if _, found := gvrs[extensions.SchemeGroupVersion.WithResource("thirdpartyresource")]; !found {
// make discovery static
snapshot, err := discoverResourcesFn()
if err != nil {