-
Notifications
You must be signed in to change notification settings - Fork 764
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: Let pubsub config controller only watch specified configmap #2959
Conversation
Thanks for the PR! This works for the current story of "pubsub only for audit", but will get more complicated when we allow multiple pubsub configs. @JaydipGabani this is another argument for having a dedicated K8s kind for configuring pubsub (in addition to RBAC and avoiding unnecessary caching of configmaps). Is that something we are working on? |
I guess using a CRD here is a good idea! |
I am not actively working on this right now, but we can discuss this again in a community meeting and figure out a road map from there if we want to. I have opened up an issue for this one though - #2802 |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2959 +/- ##
==========================================
+ Coverage 52.51% 52.57% +0.05%
==========================================
Files 134 134
Lines 11886 11886
==========================================
+ Hits 6242 6249 +7
+ Misses 5154 5149 -5
+ Partials 490 488 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Per last community call, we want to support pubsub configs as a CRD eventually, but in the meantime, let's get this PR reviewed and merged first to reduce impact on users. |
@@ -89,16 +92,16 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { | |||
&handler.EnqueueRequestForObject{}, | |||
predicate.Funcs{ | |||
CreateFunc: func(e event.CreateEvent) bool { | |||
return e.Object.GetNamespace() == util.GetNamespace() | |||
return e.Object.GetNamespace() == util.GetNamespace() && e.Object.GetName() == *AuditConnection |
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.
Please check nil before dereferencing
e.g. AuditConnection != nil && e.Object.GetName() == *AuditConnection
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.
I rebased and added the nil checks
@Mattes83 Please signoff commits to resolve CI error to merge the PR |
ping @Mattes83 |
@Mattes83 looks like DCO is missing, can you add this when you get a chance please? https://open-policy-agent.github.io/gatekeeper/website/docs/help/#developer-certification-of-origin-dco |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
@Mattes83 are you still interested in this PR? How can we help? |
Signed-off-by: Matthias Teich <[email protected]> check for nil
Signed-off-by: Mattes83 <[email protected]>
Signed-off-by: Matthias Teich [email protected]
What this PR does / why we need it:
Currently the pubsub config controller logs errors about every configmap located in the gatekeeper namespace which does not have a provider field. This should be limited to the configmap which is configured via audit-connection flag.
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #
Special notes for your reviewer: