slene commented on a change in pull request #453:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/453#discussion_r633227392



##########
File path: pkg/ingress/controller.go
##########
@@ -423,3 +455,21 @@ func (c *Controller) syncSSL(ctx context.Context, ssl 
*apisixv1.Ssl, event types
        }
        return err
 }
+
+func (c *Controller) checkClusterHealth(ctx context.Context, cancelFunc 
context.CancelFunc) {
+       for {
+               select {
+               case <-ctx.Done():
+               case <-time.After(5 * time.Second):
+               }
+
+               err := 
c.apisix.Cluster(c.cfg.APISIX.DefaultClusterName).HealthCheck(ctx)
+               if err != nil {
+                       // Finally failed health check, then give up leader.
+                       log.Warnf("failed to check health for default cluster: 
%s, give up leader", err)
+                       cancelFunc()
+                       return

Review comment:
       No, the current logic is to just discard it if it is unhealthy.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to