-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add controller-isleader xweb component to respond with 200 if the controller in question is a raft leader #2581
base: main
Are you sure you want to change the base?
Conversation
…troller is a raft leader
moved from |
Hi @nenkoru , before going too deep with this PR, we require a CLA before accepting contributions. Information on that is here: https://openziti.io/policies/CONTRIBUTING.html#code-contributions |
Hey, @plorenz! |
CLA looks good 👍 Having looked at it again, I think it looks overall. The only 2 thing I'd like changed are:
Let me know if those make sense. |
I think it gets complicated with moving this logic to a health-checks handler. We might also opt for moving this heath-check to the actual gosundheit custom check https://github.com/openziti/ziti/blob/main/controller/health.go#L15, and try to find the result of the check within that health-check loop at https://github.com/openziti/ziti/blob/main/common/health/handler.go#L99 and decide whether to return 429 status code there. Or we could just make health-checks specific for controller. Thoughts? |
Yes, this was the direction I was thinking. Leave the router health check as it is and replace the use of the common health checker with this, controller specific one. So the only changes required would be to
|
Made changes accordingly. Naming was hard, but I named this as Eg response: < HTTP/1.1 429 Too Many Requests
< Content-Type: application/json
< Date: Tue, 24 Dec 2024 21:47:33 GMT
< Content-Length: 408
<
{
"data": {
"checks": [
{
"details": null,
"healthy": true,
"id": "bolt.read",
"lastCheckDuration": "17.334µs",
"lastCheckTime": "2024-12-24T21:47:24Z"
}
],
"healthy": true
},
"meta": {},
"raft": {
"isLeader": false,
"isRaftEnabled": true
}
} Also I skimmed the zititest but couldn't an appropriate place to put tests for this behaviour. I guess after tests created I could unmark this PR as being a draft and we could continue iterating on this! |
closes(backref) #2582