-
Notifications
You must be signed in to change notification settings - Fork 33
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: simplify wehbook configuration controller handlers #894
refactor: simplify wehbook configuration controller handlers #894
Conversation
e921c46
to
c50360c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #894 +/- ##
==========================================
- Coverage 69.33% 69.27% -0.06%
==========================================
Files 30 30
Lines 3052 3040 -12
==========================================
- Hits 2116 2106 -10
+ Misses 769 767 -2
Partials 167 167
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 an interesting approach. Are there consequences caused by using a field indexer?
I don't think so. However I'd like to proceed with the |
5525634
to
84a9df8
Compare
… annotations Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
84a9df8
to
281414e
Compare
Description
Before this change, we leveraged several annotations to check if a
WebhookConfiguration
was related to the type of policy managed by a controller.For instance, the
scope
andgroup
annotations were used to check if a policy was cluster or namespace scoped and if it was a group.When adding
PolicyGroups
we realized that it was hard to maintain multiple annotations.This PR simplifies the
WebhookConfiguration
controller handlers, by using just two annotations (name
andnamespace
)and by using the client to check if the resource of a certain type exists.This is ok regarding performance and API server load since the request is cached.
and returning a reconcile request.