-
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
agent: consolidate handling of 405 Method Not Allowed #3405
Conversation
Hmm, two tests are still failing which I'll fix but I'd appreciate feedback on the approach nevertheless. |
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 though I think with some of the slop that we had before this is considered a breaking change. We should probably hold this one until 1.0, unfortunately.
Thought about a helper so we don't have to stutter the methods into the error, but it seemed like overkill for 3 lines of code, so the approach looks good. |
97a6a30
to
4970bbc
Compare
OK, then I'll just merge the doc change for now. |
117d414
to
e45099f
Compare
e45099f
to
68579d7
Compare
Rebased to master |
0ca7c7e
to
d717120
Compare
This patch uses the error handling of the http handlers to handle HTTP method not allowed errors across all available endpoints. It also adds a test for testing whether the endpoints respond with the correct status code.
/agent/join uses PUT instead of GET as documented.
/agent/check/{fail,warn,pass} uses PUT instead of GET as documented.
d717120
to
923e359
Compare
5f399f0
to
ad7ff02
Compare
ad7ff02
to
f095d49
Compare
Is there a way to disable this check in >1.0.0, like a flag? We have some legacy system that were run on 0.6.3, but I would like to use the consul docker with is using 1.0.1, thus breaking the legacy system. Thanks! |
Hi @kyeett unfortunately not - we wanted to break these and tighten up the handling as part of 1.0 so we would be in a better position to support Consul's interfaces for the long term. |
A colleague helped me find the somewhat hidden consul:0.9.3 docker image :-) We will use that for now. |
This patch consolidates the handling of the 405 Method Not Allowed status code and updates documentation and methods according to both each other and reality.
There is a new test which covers all endpoints and which replaces the spurious other tests for this status code.
I'm open to move the definition of which status codes are allowed somewhere else or to refactor the code to something more readable or better suited.