mayocream commented on a change in pull request #770:
URL:
https://github.com/apache/apisix-ingress-controller/pull/770#discussion_r767028754
##########
File path: pkg/ingress/controller.go
##########
@@ -653,6 +653,10 @@ func (c *Controller) checkClusterHealth(ctx
context.Context, cancelFunc context.
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)
+ c.apiServer.HealthState.Lock()
+ defer c.apiServer.HealthState.Unlock()
+
+ c.apiServer.HealthState.Err = err
Review comment:
Any suggestions about it? Inserting the health state struct into
`cluster` is kinda unnecessary I think (we had `cacheSyncErr`).
We might wanna add a function, be like `APISIX.Health()`, it returns the
health state of all clusters.
Or we can just leave it in here (`checkClusterHealth`).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]