Skip to content

Commit 7f7879d

Browse files
fix flake test of TestUpdateClusterEventHandler
Signed-off-by: changzhen <[email protected]>
1 parent 079d0ab commit 7f7879d

File tree

2 files changed

+51
-163
lines changed

2 files changed

+51
-163
lines changed

pkg/search/controller.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,6 @@ func (c *Controller) getRegistryBackendHandler(cluster string, matchedRegistries
350350
return handler, nil
351351
}
352352

353-
var controlPlaneClientBuilder = func(restConfig *rest.Config) client.Client {
354-
return gclient.NewForConfigOrDie(restConfig)
355-
}
356353
var clusterDynamicClientBuilder = func(cluster string, controlPlaneClient client.Client) (*util.DynamicClusterClient, error) {
357354
return util.NewClusterDynamicClientSet(cluster, controlPlaneClient)
358355
}
@@ -394,7 +391,7 @@ func (c *Controller) doCacheCluster(cluster string) error {
394391
// STEP2: added/updated cluster, builds an informer manager for a specific cluster.
395392
if !c.InformerManager.IsManagerExist(cluster) {
396393
klog.Info("Try to build informer manager for cluster ", cluster)
397-
controlPlaneClient := controlPlaneClientBuilder(c.restConfig)
394+
controlPlaneClient := gclient.NewForConfigOrDie(c.restConfig)
398395

399396
clusterDynamicClient, err := clusterDynamicClientBuilder(cluster, controlPlaneClient)
400397
if err != nil {

0 commit comments

Comments
 (0)