feat(plugins) allow cross-namespace KCP plugins #5913
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Removes the internal namespace tag when generating plugin configuration sets for KongClusterPlugins attached to multiple resources.
Previously, KongClusterPlugins attached to multiple resources of different types effectively behaved like one or more KongPlugins attached to each of those resources with respect to namespaces. A KongClusterPlugin attached to a Service and a KongConsumer in one namespace (A) and a KongConsumer in another (B) would result two plugin instances, one attached to a Kong service and consumer (namespace A) and one attached to a consumer only (namespace B).
After this change both plugins would be attached to a consumer and a service (the same service, but different consumers).
Which issue this PR fixes:
Fix #5355
Special notes for your reviewer:
This is possibly more of a breaking change than I initially thought.
The code to handle this is currently ugly as heck and duplicated. There's probably a cleaner way to refactor the larger plugin system.
This is manually tested to have the desired effect with plugin-demo.yaml.txt.
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR