-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix(api): use POST to add targets to specific upstream #8798
Conversation
@Kong/gateway-moderators Can someone review and approve and merge this PR. This is blocking https://konghq.atlassian.net/browse/ENGEN-593. |
In Kong 2.x series, for a compatibility with old versions, it was possible to update targets using POST method. When fixing this behavior, the path /upstreams/{upstream}/targets was mistakenly changed to also use PUT method, instead of only blocking adding duplicated targets. This change fixes this behavior.
ff49f02
to
cb38cf2
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.
The changelog currently contains this note in the Breaking Changes section:
Insert and update operations on target entities require using the PUT HTTP method now. https://github.com/Kong/kong/pull/8596. If you have scripts that depend on it being POST, these scripts will need to be updated when updating to Kong 3.0.
I believe it should be updated according to the changes on this PR. My suggestion:
POST requests on Target entities will no longer be able to update existing entities, they will only be able to create new ones. https://github.com/Kong/kong/pull/8596, https://github.com/Kong/kong/pull/8798. If you have scripts that use POST requests to modify Targets, you should change them to PUT requests before updating to Kong 3.0.
Disable analysis in stream module to avoid unnecessary error logs. FTI-5845
Summary
In Kong 2.x series it was possible to update targets using
POST
method. When fixing this behavior, the path/upstreams/{upstream}/targets
was mistakenly changed to also usePUT
method, instead of only blocking adding duplicated targets. This PR changes it.Full changelog
PUT
in/upstreams/{upstream}/targets
POST
.Cherry-picked fix(balancer) set target status using hostname #8797, in order to the tests to pass.Needed sister PR already merged.FT-2874
DECK-64