Skip to content

Commit

Permalink
Merge pull request #5856 from XiShanYongYe-Chang/flake-TestUpdateClus…
Browse files Browse the repository at this point in the history
…terEventHandler

fix flake test of TestUpdateClusterEventHandler
  • Loading branch information
karmada-bot authored Nov 22, 2024
2 parents 4dbcfaf + 7da6423 commit 8691287
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 170 deletions.
5 changes: 1 addition & 4 deletions pkg/search/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,6 @@ func (c *Controller) getRegistryBackendHandler(cluster string, matchedRegistries
return handler, nil
}

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

clusterDynamicClient, err := clusterDynamicClientBuilder(cluster, controlPlaneClient)
if err != nil {
Expand Down
Loading

0 comments on commit 8691287

Please sign in to comment.