-
Notifications
You must be signed in to change notification settings - Fork 592
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
refactor: use plugin annotation types from kubernetes-configuration #6644
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6644 +/- ##
=======================================
+ Coverage 77.7% 78.9% +1.1%
=======================================
Files 202 202
Lines 23758 23798 +40
=======================================
+ Hits 18483 18794 +311
+ Misses 4335 4052 -283
- Partials 940 952 +12 ☔ View full report in Codecov by Sentry. |
aa91d31
to
8c7ae94
Compare
8c7ae94
to
6bc1d31
Compare
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.
IMHO using the interface makes this more flexible and is worth the small decrease in performance.
👍
…re already defined on ObjectMeta
What this PR does / why we need it:
This PR uses functions that interact with objects' plugin annotations from Kong/kubernetes-configuration#144.
Some of those introduce the usage of iterators using theiter
package to prevent unnecessary allocations.Benchmarks
go test -v -benchmem -bench BenchmarkGetPluginRelations -run ^$ -count 1 ./internal/dataplane/kongstate
Old
New
NOTE: the decrease in performance comes from using the interface that contains a method which returns a
map
vs passing just themap
around like it was done previously. If the team feels this is not worth it we can change this back to previous approach. IMHO using theinterface
makes this more flexible and is worth the small decrease in performance.Here's a proposal on how to optimize the functions themselves: Kong/kubernetes-configuration@d8803db