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

feat: KongPluginBinding API refactoring #11

Merged
merged 11 commits into from
Aug 8, 2024

Conversation

mlavacca
Copy link
Member

@mlavacca mlavacca commented Jul 29, 2024

What this PR does / why we need it:

This PR is a proposal to make the target references in the KongPluginBinding resource generic.
The rationale is:

  • Route can be KongRoute, Ingress, *Route
  • Service can KongService, Service
  • if the routeRef is a KongRoute, the serviceRef must be unset or a KongService. The other way around applies as well.

This way we are able to reference all the K8s objects we need, and at the same time enforce the rules posed by https://docs.konghq.com/gateway/latest/key-concepts/plugins/#precedence.

Which issue this PR fixes

Fixes #7

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect significant changes

@mlavacca mlavacca requested a review from pmalek July 29, 2024 10:34
@mlavacca mlavacca marked this pull request as draft July 29, 2024 10:34
@mheap
Copy link
Member

mheap commented Aug 6, 2024

I prefer this schema to the existing one 🙌

Signed-off-by: Mattia Lavacca <[email protected]>
@mlavacca mlavacca force-pushed the mlavacca/pluginbindings-generic-refs branch from 67a514c to bff22af Compare August 8, 2024 07:42
@mlavacca mlavacca changed the title feat: kpb refs refactoring feat: KongPluginBinding API refactoring Aug 8, 2024
@mlavacca mlavacca force-pushed the mlavacca/pluginbindings-generic-refs branch from bff22af to 22bf71e Compare August 8, 2024 07:48
@mlavacca mlavacca force-pushed the mlavacca/pluginbindings-generic-refs branch from 22bf71e to c14503d Compare August 8, 2024 07:50
@mlavacca mlavacca marked this pull request as ready for review August 8, 2024 08:00
@mlavacca mlavacca requested a review from a team as a code owner August 8, 2024 08:00
config/samples/kongpluginbinding.yaml Outdated Show resolved Hide resolved
config/samples/kongpluginbinding.yaml Show resolved Hide resolved
api/configuration/v1alpha1/kongpluginbinding_types.go Outdated Show resolved Hide resolved
api/configuration/v1alpha1/kongpluginbinding_types.go Outdated Show resolved Hide resolved
@mlavacca mlavacca requested a review from pmalek August 8, 2024 11:48
Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

Just minor nits. Feel free to address them in this PR or a separate one.

@mlavacca mlavacca enabled auto-merge (squash) August 8, 2024 14:27
@mlavacca mlavacca merged commit 8cefe8d into main Aug 8, 2024
4 checks passed
@mlavacca mlavacca deleted the mlavacca/pluginbindings-generic-refs branch August 8, 2024 14:28
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.

How to configure KongPluginBindings to be global
3 participants