Skip to content

fix: register current admission webhook subresources - #4785

Open
JaydipGabani wants to merge 3 commits into
open-policy-agent:masterfrom
JaydipGabani:fix/webhook-subresources
Open

fix: register current admission webhook subresources#4785
JaydipGabani wants to merge 3 commits into
open-policy-agent:masterfrom
JaydipGabani:fix/webhook-subresources

Conversation

@JaydipGabani

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Registers the current known non-status subresources for both admission webhooks so requests such as namespace finalization, service account token creation, certificate signing request approval, and pod resize are sent to Gatekeeper with matchPolicy: Exact. This keeps the generated manifests and Helm defaults consistent while preserving services/status as the only explicit status-subresource exception.

Which issue(s) this PR fixes:

N/A

Special notes for your reviewer:

The two external-data Go hunks are formatting-only.

Validation:

  • make manifests
  • make lint
  • GOTOOLCHAIN=go1.26.0 GOCACHE=/tmp/gatekeeper-webhook-subresources-gocache make native-test LOCALBIN=/tmp/gatekeeper-webhook-subresources-bin

Register known non-status subresources for both admission webhooks so exact-match rules handle namespace finalization, token requests, CSR approvals, pod resize, and the existing supported subresources consistently.

Regenerate webhook manifests and Helm chart staging outputs while continuing to exclude status subresources except services/status.

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
@JaydipGabani
JaydipGabani requested a review from a team as a code owner August 26, 2026 00:15
Copilot AI balanced review requested due to automatic review settings August 26, 2026 00:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Registers current non-status Kubernetes subresources with both admission webhooks while retaining services/status.

Changes:

  • Adds namespace finalization, token creation, CSR approval, and pod resize coverage.
  • Synchronizes generated manifests and Helm defaults.
  • Applies incidental Go formatting fixes.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/webhook/policy.go Extends validating webhook rules.
pkg/webhook/mutation.go Extends mutating webhook rules.
pkg/mutation/system_external_data.go Formatting only.
pkg/controller/externaldata/stats_reporter.go Formatting only.
config/webhook/manifests.yaml Updates generated webhook configurations.
manifest_staging/deploy/gatekeeper.yaml Updates staged deployment manifest.
manifest_staging/charts/gatekeeper/values.yaml Updates staged Helm defaults.
manifest_staging/charts/gatekeeper/templates/gatekeeper-validating-webhook-configuration-validatingwebhookconfiguration.yaml Updates discovery guidance.
manifest_staging/charts/gatekeeper/README.md Documents staged defaults.
cmd/build/helmify/static/values.yaml Updates Helm source defaults.
cmd/build/helmify/static/README.md Documents source defaults.
cmd/build/helmify/replacements.go Updates generated template guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov-commenter

codecov-commenter commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.85%. Comparing base (3350319) to head (9c36b81).
⚠️ Report is 862 commits behind head on master.

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

HEAD has 1 upload less than BASE
Flag BASE (3350319) HEAD (9c36b81)
unittests 2 1
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4785      +/-   ##
==========================================
- Coverage   54.49%   47.85%   -6.65%     
==========================================
  Files         134      290     +156     
  Lines       12329    22908   +10579     
==========================================
+ Hits         6719    10963    +4244     
- Misses       5116    10984    +5868     
- Partials      494      961     +467     
Flag Coverage Δ
unittests 47.85% <100.00%> (-6.65%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI review requested due to automatic review settings August 26, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 26, 2026 22:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated no new comments.

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.

3 participants