-
Notifications
You must be signed in to change notification settings - Fork 815
fix: add RBAC for finalizers when running with OwnerReferencesPermissionEnforcement admission plugin #3961
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
Conversation
…nt admission plugin Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3961 +/- ##
===========================================
- Coverage 54.49% 38.97% -15.53%
===========================================
Files 134 236 +102
Lines 12329 20133 +7804
===========================================
+ Hits 6719 7847 +1128
- Misses 5116 11710 +6594
- Partials 494 576 +82
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -247,6 +247,8 @@ type ReconcileConstraintTemplate struct { | |||
// +kubebuilder:rbac:groups=templates.gatekeeper.sh,resources=constrainttemplates,verbs=get;list;watch;create;update;patch;delete | |||
// +kubebuilder:rbac:groups=templates.gatekeeper.sh,resources=constrainttemplates/status,verbs=get;update;patch | |||
// +kubebuilder:rbac:groups=externaldata.gatekeeper.sh,resources=providers,verbs=get;list;watch;create;update;patch;delete | |||
// finalizers is needed for OwnerReferencesPermissionEnforcement admission plugin. | |||
// +kubebuilder:rbac:groups=templates.gatekeeper.sh,resources=constrainttemplates/finalizers,verbs=get;update;patch;delete |
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.
Can you please add a link to where this is documented and verify if we need all these verbs or just the update
one.
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.
update
verb is enough, updated the rbac and added a link to documentation as well.
Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
Can you also update the e2e (enable the OwnerReferencesPermissionEnforcement admission plugin) to test this? should fail without this clusterrole and succeed with it deployed). If we had the test, it would have caught the issue. |
Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
@ritazh addded tests to create sample CT when admission plugin is enabled. |
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! LGTM
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.
LGTM
…ionEnforcement admission plugin (open-policy-agent#3961) Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com> Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
…ionEnforcement admission plugin (open-policy-agent#3961) Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com> Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
…ionEnforcement admission plugin (open-policy-agent#3961) Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com> Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
…ionEnforcement admission plugin (open-policy-agent#3961) Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com> Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com> Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
…ionEnforcement admission plugin (open-policy-agent#3961) Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com> Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
What this PR does / why we need it:
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 #3960
Special notes for your reviewer: