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: correctly handle route schema defaults with Konnect #55

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

GGabriele
Copy link
Collaborator

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

  • [Implement ...]
  • [Fix ...]

Issues resolved

Fix #XXX

Documentation

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

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.
@GGabriele GGabriele requested a review from a team February 7, 2024 07:56
Copy link
Contributor

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

@GGabriele GGabriele merged commit 1147ba2 into main Feb 7, 2024
39 checks passed
@GGabriele GGabriele deleted the fix/expressions-router branch February 7, 2024 09:50
// 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

traditiona -> traditional 🙃

Comment on lines +2838 to +2840
d, _ := utils.GetDefaulter(ctx, defaulterTestOpts)
b.defaulter = d
b.intermediate, _ = state.NewKongState()
Copy link
Member

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?

Copy link
Collaborator Author

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

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

Successfully merging this pull request may close these issues.

3 participants