-
Notifications
You must be signed in to change notification settings - Fork 128
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
service
field under a plugin should be ignored for nested routes
#1353
Comments
My expectation of behaviour would be:
Can you help us understand how you landed on this configuration? |
[noob kong user here] while working on the config above I wanted to add a
|
As of now, while using deck to create a route-scoped plugin with a `service` field defined, the sync goes through the first time but errors out subsequently. Under a route, we do not want the user to add the `service` field for a plugin. Thus, we are checking for this specific scenario and erroring out, instead of letting the sync action go through. For: Kong/deck#1353
As of now, while using deck to create a route-scoped plugin with a `service` field defined, the sync goes through the first time but errors out subsequently. Under a route, we do not want the user to add the `service` field for a plugin. Thus, we are checking for this specific scenario and erroring out, instead of letting the sync action go through. For: Kong/deck#1353
* fix: returning a validation error in case of wrong configuration. As of now, while using deck to create a route-scoped plugin with a `service` field defined, the sync goes through the first time but errors out subsequently. Under a route, we do not want the user to add the `service` field for a plugin. Thus, we are checking for this specific scenario and erroring out, instead of letting the sync action go through. For: Kong/deck#1353 * fix: added checks for all conflicting nested configs in plugins. A foreign key nested under a plugin of a different scope would error out. This would make sure that a sync does not go through when wrong configurations are passed via deck. An example would be adding a `service` field in a plugin, nested under a route. This change ensures more such issues do not come up. * test: added integration test for validations related to scoped plugins * chore: removed redundant code lines * chore: removed stray code lines from test * test: fixed tests and added more for kong <3.0 * chore: addressed PR comments
If the value of
service.routes[*].plugins[*].service
is set to the same service in which the route is nested, applying the configuration returns anentity already exists
error.For example, consider the following configuration:
Applying it succeeds first time, but fails second time with an
entity already exists error
. Deleting the plugin manually from the service then re-applying works, but still fails on the next apply with the same issue.Options:
service
field in plugins under a route which is explicitly defined under a serviceservice
field for the plugin matches the service name under which the route is nested, otherwise return a validation errorThe text was updated successfully, but these errors were encountered: