Skip to content

Commit

Permalink
Merge pull request #3018 from yanfeng1992/automated-cherry-pick-of-#3…
Browse files Browse the repository at this point in the history
…010-upstream-release-1.2

Automated cherry pick of #3010: search filter out not ready cluster
  • Loading branch information
karmada-bot authored Jan 4, 2023
2 parents 739d2c3 + aad6017 commit 123c50b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/search/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (c *Controller) doCacheCluster(cluster string) error {
return nil
}

// STEP1: stop informer manager for the cluster which does not exist anymore.
// STEP1: stop informer manager for the cluster which does not exist anymore or is not ready.
cls, err := c.clusterLister.Get(cluster)
if err != nil {
if apierrors.IsNotFound(err) {
Expand All @@ -195,6 +195,12 @@ func (c *Controller) doCacheCluster(cluster string) error {
return nil
}

if !util.IsClusterReady(&cls.Status) {
klog.Warningf("cluster %s is notReady try to stop this cluster informer", cluster)
c.InformerManager.Stop(cluster)
return nil
}

// 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)
Expand Down

0 comments on commit 123c50b

Please sign in to comment.