-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Support HEAD request for http check #2474
Conversation
If you are interested in such change, tell me and I'll write associated tests. |
tests are failing on the master branch https://travis-ci.org/hashicorp/consul/builds/173459471 I'll try to rebase when master goes green again. In the meantime, feel free to provide feedback |
Hi @kamaradclimber this looks good! If you'd like to add the associated tests I think we can pull this in. |
d8dbfd4
to
4068d02
Compare
@slackpad I've added tests. Would you have advices regarding failing tests? I'm unable to see if it is related to my patch or not. |
@@ -420,7 +422,11 @@ func (c *CheckHTTP) run() { | |||
|
|||
// check is invoked periodically to perform the HTTP check | |||
func (c *CheckHTTP) check() { | |||
req, err := http.NewRequest("GET", c.HTTP, nil) | |||
method := "GET" |
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.
use http.MethodGet
here
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.
done
req, err := http.NewRequest("GET", c.HTTP, nil) | ||
method := "GET" | ||
if c.Head { | ||
method = "HEAD" |
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.
use http.MethodHead
here
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.
done
thanks for the feedback @simplechris |
bc58c26
to
680016e
Compare
Hi @slackpad, I finally managed to make test pass. Would you have any feedback regarding this PR? |
I've just rebased. @slackpad any feedback? |
5d40964
to
c5b40f5
Compare
This will allow to avoid http checks whose output churn a lot (statistics endpoint for instance). Such checks are quite common when the checked service does not provide a `/health` endpoint. Fix: hashicorp#2473 Change-Id: Ice13ccf0ecb58be13e17a2843cdac7871e6579ac
Hello @slackpad, would you have some feedback on this PR? Thanks |
Hello @slackpad, would you have some comments? |
@slackpad @simplechris any feedback on that PR. What can I do to make it progress? |
¯\_(ツ)_/¯ LGTM |
Sorry for the delay on this one and that I didn't notice this earlier - we should make the HTTP method more generic and not special-case for |
will use the new feature in 0.8.4 thanks! |
This will allow to avoid http checks whose output churn a lot (statistics
endpoint for instance). Such checks are quite common when the checked
service does not provide a
/health
endpoint.Fix #2473.