Commit ee47db8c authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #39399 from zhouhaibing089/namespace-controller

Automatic merge from submit-queue make discovery static when extensions/thirdpartyresources is not enabled this should be a bug fix, if `extensions/thirdpartyresources` is enabled, the result of `Discovery().ServerPreferredNamespacedResources` will be dynamic then, so we are making the `discoverResourcesFn` static only when the `extensions/thirdpartyresources` is not enabled.
parents 17f8d82f a09fc738
...@@ -115,7 +115,7 @@ func startNamespaceController(ctx ControllerContext) (bool, error) { ...@@ -115,7 +115,7 @@ func startNamespaceController(ctx ControllerContext) (bool, error) {
return true, fmt.Errorf("failed to parse preferred server resources: %v", err) return true, fmt.Errorf("failed to parse preferred server resources: %v", err)
} }
discoverResourcesFn := namespaceKubeClient.Discovery().ServerPreferredNamespacedResources discoverResourcesFn := namespaceKubeClient.Discovery().ServerPreferredNamespacedResources
if _, found := gvrs[extensions.SchemeGroupVersion.WithResource("thirdpartyresource")]; found { if _, found := gvrs[extensions.SchemeGroupVersion.WithResource("thirdpartyresource")]; !found {
// make discovery static // make discovery static
snapshot, err := discoverResourcesFn() snapshot, err := discoverResourcesFn()
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment