Skip to content

Conversation

JaydipGabani
Copy link
Contributor

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:

…nt admission plugin

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
@JaydipGabani JaydipGabani requested a review from a team as a code owner May 9, 2025 20:43
@codecov-commenter
Copy link

codecov-commenter commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.97%. Comparing base (3350319) to head (09c6a7e).
Report is 367 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (3350319) and HEAD (09c6a7e). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3350319) HEAD (09c6a7e)
unittests 2 1
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     
Flag Coverage Δ
unittests 38.97% <ø> (-15.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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>
@JaydipGabani JaydipGabani requested a review from ritazh May 15, 2025 22:45
@ritazh
Copy link
Member

ritazh commented May 15, 2025

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.

@JaydipGabani
Copy link
Contributor Author

@ritazh addded tests to create sample CT when admission plugin is enabled.

@JaydipGabani JaydipGabani requested a review from sozercan June 10, 2025 22:02
Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@ritazh ritazh changed the title fix: adding fializers to play nice with OwnerReferencesPermissionEnforcement admission plugin fix: adding finalizers to play nice with OwnerReferencesPermissionEnforcement admission plugin Jun 12, 2025
@ritazh ritazh changed the title fix: adding finalizers to play nice with OwnerReferencesPermissionEnforcement admission plugin fix: add RBAC for finalizers when running with OwnerReferencesPermissionEnforcement admission plugin Jun 12, 2025
Copy link
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ritazh ritazh merged commit 9469f18 into open-policy-agent:master Jun 12, 2025
22 checks passed
grelland pushed a commit to grelland/gatekeeper that referenced this pull request Jun 12, 2025
…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>
dhaiducek pushed a commit to dhaiducek/gatekeeper that referenced this pull request Jun 12, 2025
…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>
openshift-merge-bot bot pushed a commit to stolostron/gatekeeper that referenced this pull request Jun 13, 2025
…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>
sozercan pushed a commit to sozercan/gatekeeper that referenced this pull request Jun 18, 2025
…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>
dhaiducek pushed a commit to dhaiducek/gatekeeper that referenced this pull request Jul 29, 2025
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing constrainttemplates/finalizers RBAC rule causes CRD creation failure in Gatekeeper 3.19.1
4 participants