Skip to content
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

Merged
merged 2 commits into from
May 20, 2022

Conversation

locao
Copy link
Contributor

@locao locao commented May 12, 2022

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 use PUT method, instead of only blocking adding duplicated targets. This PR changes it.

Full changelog

FT-2874
DECK-64

@locao locao requested a review from a team as a code owner May 12, 2022 20:30
@locao locao added this to the 3.0 milestone May 12, 2022
@saisatishkarra saisatishkarra changed the title fix(api) use POST to add targets to specific upstream fix(api): use POST to add targets to specific upstream May 13, 2022
@saisatishkarra
Copy link
Contributor

@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.
Copy link
Member

@kikito kikito left a 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.

@locao locao requested a review from kikito May 19, 2022 14:31
@locao locao merged commit fcb7275 into master May 20, 2022
@locao locao deleted the fix/target_creation_method branch May 20, 2022 02:13
locao pushed a commit that referenced this pull request Apr 24, 2024
Disable analysis in stream module to avoid unnecessary error logs.

FTI-5845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants