-
Notifications
You must be signed in to change notification settings - Fork 3
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: correctly handle route schema defaults with Konnect #55
Conversation
Kong Gateway supports different schemas for different router versions. On the other hand, Konnect can support only one schema including all fields from 'traditional' and 'expressions' router schemas. This may be problematic when it comes to defaults injection, because the defaults for the 'traditiona' router schema can be wrongly injected into the 'expressions' route configuration. Here we make sure that only the fields that are supported for a given router version are set in the route configuration.
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.
Thanks for that @GGabriele! 🎖️ I verified it works as expected in KIC.
// On the other hand, Konnect can support only one schema including all | ||
// fields from 'traditional' and 'expressions' router schemas. | ||
// This may be problematic when it comes to defaults injection, because | ||
// the defaults for the 'traditiona' router schema can be wrongly injected |
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.
traditiona
-> traditional
🙃
d, _ := utils.GetDefaulter(ctx, defaulterTestOpts) | ||
b.defaulter = d | ||
b.intermediate, _ = state.NewKongState() |
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.
Too late to the party but any particular reason not to check the errors 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.
could be done, but not meaningful for the specific test...copy&pasta mistake
Kong Gateway supports different schemas for different router versions. On the other hand, Konnect can support only one schema including all fields from 'traditional' and 'expressions' router schemas. This may be problematic when it comes to defaults injection, because the defaults for the 'traditiona' router schema can be wrongly injected into the 'expressions' route configuration.
Here we make sure that only the fields that are supported for a given router version are set in the route configuration.
Summary
SUMMARY_GOES_HERE
Full changelog
Issues resolved
Fix #XXX
Documentation
Testing