mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
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.
This commit is contained in:
commit
ee47db8c84
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user