-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Added param options to /healthz endpoint #3326
Conversation
1ca1656
to
208858c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. Would you mind adding a test for the Healthz system changes, probably in test TestServerEventsPingMonitorz()? Also asking @matthiashanel for help reviewing the system event change. It looks ok to me, but would want to make sure.
d5ae6c0
to
0134fff
Compare
07bbc22
to
467a9a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little typo and some tweak to the test and we should be good to go. Thanks!
server/jetstream_test.go
Outdated
defer s.Shutdown() | ||
|
||
if s.JetStreamEnabled() { | ||
t.Fatalf("Expected JetStream to be disbaled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here that causes our checks to fail:
./server/jetstream_test.go:17518:37: "disbaled" is a misspelling of "disabled"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
server/jetstream_test.go
Outdated
@@ -17508,6 +17508,25 @@ func TestJetStreamWorkQueueSourceNamingRestart(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestJetStreamDisabledHealthz(t *testing.T) { | |||
s := RunRandClientPortServer() | |||
if config := s.JetStreamConfig(); config != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary since you are not configuring a server with JetStream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
f6b5c22
to
1634f33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Follow up from #4437 content-type fix for v2.9.22, some fixes to the response from `/healthz` for dev: - In #[3326](#4097) it was changed to return 500 status when before we used to return 503 so this changes it back. - Also as part of #3326 we started to return `status_code` in the healthz response (e.g `{"status":"ok","status_code":200}`) so this removes it for http responses just relying on the http header.
Resolves #NNN
git pull --rebase origin main
)Related to # nats-io/k8s#541
Resolves # The JetStream portion of #2687
Changes proposed in this pull request:
/healthz?js-enabled=true
to return error if JetStream is disabled./healthz?js-server-only=true
to skip checking of JetStream accounts, streams and consumers./cc @nats-io/core