Skip to content

feat: Add validationActions field type to PolicyException to override vpol validationAction#85

Open
naseyro wants to merge 1 commit into
kyverno:mainfrom
naseyro:allow-vpol-override
Open

feat: Add validationActions field type to PolicyException to override vpol validationAction#85
naseyro wants to merge 1 commit into
kyverno:mainfrom
naseyro:allow-vpol-override

Conversation

@naseyro

@naseyro naseyro commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Explanation

We need to support override for ValidatingPolicy validationActions in PolicyException so in order to do that we need to define the validationAction field first in PolicyException API

For the CEL version

Related issue

Needed for: kyverno/kyverno#14927 and its PR: kyverno/kyverno#16481

Proposed Changes

  • Add validationAction field to PolicyException

Checklist

  • I have read the contributing guidelines.
  • I have read the PR documentation guide and followed the process including adding proof manifests to this PR.
  • This is a bug fix and I have added unit tests that prove my fix is effective.

Further Comments

@realshuting

Copy link
Copy Markdown
Member

Why do we need this?

@realshuting

Copy link
Copy Markdown
Member

The original issue is to add this field in policyexception to override the failure action.

@naseyro

naseyro commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

The original issue is to add this field in policyexception to override the failure action.

@realshuting I think I misunderstood this, I thought about introducing an override for validationActions

@naseyro naseyro force-pushed the allow-vpol-override branch 2 times, most recently from f495ee2 to e788b66 Compare May 1, 2026 02:55
@naseyro naseyro changed the title feat: Add ValidationActionsOverride field type to ValidatingPolicy feat: Add validationActions field type to PolicyException to override vpol failureAction May 1, 2026
@naseyro

naseyro commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

The original issue is to add this field in policyexception to override the failure action.

@realshuting I made changes and updated the PR title and description

Comment thread api/policies.kyverno.io/v1alpha1/policy_exception.go Outdated
Comment thread api/policies.kyverno.io/v1alpha1/policy_exception.go
Comment thread api/policies.kyverno.io/v1alpha1/policy_exception.go Outdated
@realshuting

Copy link
Copy Markdown
Member

Please resolve all comments once addressed.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the PolicyException API to support overriding a referenced policy’s validationActions, enabling per-exception control over ValidatingPolicy enforcement behavior.

Changes:

  • Added validationActions to PolicyRef in the PolicyException API (Go types + deepcopy support).
  • Updated generated CRD manifests (raw + aggregated + Helm chart template) to expose the new field.
  • Updated generated CRD documentation HTML to include the new field.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
docs/user/crd/kyverno_cel_policies.v1alpha1.html Generated CRD docs updated to document validationActions on PolicyRef.
docs/user/crd/index.html Generated CRD index updated to include validationActions in PolicyRef.
config/crds/policies.kyverno.io_policyexceptions.yaml PolicyException CRD schema updated to include policyRefs[].validationActions (multiple version blocks).
config/crds.yaml Aggregated CRDs updated to include policyRefs[].validationActions (multiple version blocks).
charts/kyverno-api/templates/crds/policies.kyverno.io_policyexceptions.yaml Helm CRD template updated to include policyRefs[].validationActions (multiple version blocks).
api/policies.kyverno.io/v1alpha1/zz_generated.deepcopy.go Deepcopy generation updated to deep-copy PolicyRef elements due to the new slice field.
api/policies.kyverno.io/v1alpha1/policy_exception.go Added validationActions field to PolicyRef.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/policies.kyverno.io/v1alpha1/policy_exception.go
Comment thread api/policies.kyverno.io/v1alpha1/policy_exception.go Outdated
Comment thread config/crds/policies.kyverno.io_policyexceptions.yaml Outdated
Comment thread config/crds.yaml Outdated
Comment thread charts/kyverno-api/templates/crds/policies.kyverno.io_policyexceptions.yaml Outdated
Comment thread config/crds/policies.kyverno.io_policyexceptions.yaml Outdated
Comment thread config/crds.yaml Outdated
Comment thread config/crds.yaml Outdated
Comment thread charts/kyverno-api/templates/crds/policies.kyverno.io_policyexceptions.yaml Outdated
Comment thread charts/kyverno-api/templates/crds/policies.kyverno.io_policyexceptions.yaml Outdated
@naseyro naseyro requested a review from realshuting May 21, 2026 19:55
@naseyro naseyro force-pushed the allow-vpol-override branch from 202219c to feb5a4d Compare July 3, 2026 02:48
@naseyro naseyro changed the title feat: Add validationActions field type to PolicyException to override vpol failureAction feat: Add validationActions field type to PolicyException to override vpol validationAction Jul 3, 2026
@naseyro naseyro force-pushed the allow-vpol-override branch from feb5a4d to a1f46a7 Compare July 3, 2026 04:50
Signed-off-by: Omar Nasser <omarnasserjr@gmail.com>
@naseyro naseyro marked this pull request as draft July 3, 2026 05:30
@naseyro naseyro marked this pull request as ready for review July 7, 2026 04:48
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