Repository navigation
feat: add target match conditions to mutating policies - #112
Merged
realshuting merged 2 commits intoJul 16, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends Kyverno’s mutating policy API to support additional, post-resolution filtering of mutation targets via a new targetMatchConditions field, and updates the generated CRDs/Helm templates/docs to describe the evaluation order and target routing behavior.
Changes:
- Add
targetMatchConditionstoMutatingPolicySpecand regenerate deepcopy code. - Update CRD schemas (standalone + aggregated) and Helm CRD templates to include the new field and updated descriptions.
- Update generated CRD HTML/reference docs to reflect trigger vs target evaluation ordering and subresource routing (e.g.,
pods/resize).
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/user/crd/kyverno_cel_policies.v1alpha1.html | Generated CRD docs updated to include targetMatchConditions and revised evaluation/routing text. |
| docs/user/crd/index.html | Generated consolidated CRD index updated for the new field and revised descriptions across versions. |
| config/crds/policies.kyverno.io_namespacedmutatingpolicies.yaml | Namespaced MutatingPolicy CRD schema updated with targetMatchConditions and revised descriptions. |
| config/crds/policies.kyverno.io_mutatingpolicies.yaml | Cluster MutatingPolicy CRD schema updated with targetMatchConditions and revised descriptions. |
| config/crds.yaml | Aggregated CRDs bundle updated to include the new schema and docstrings. |
| charts/kyverno-api/templates/crds/policies.kyverno.io_namespacedmutatingpolicies.yaml | Helm-packaged Namespaced MutatingPolicy CRD updated to match new schema/docs. |
| charts/kyverno-api/templates/crds/policies.kyverno.io_mutatingpolicies.yaml | Helm-packaged MutatingPolicy CRD updated to match new schema/docs. |
| api/policies.kyverno.io/v1alpha1/zz_generated.deepcopy.go | Regenerated deepcopy logic to copy TargetMatchConditions. |
| api/policies.kyverno.io/v1alpha1/mutating_policy.go | API type docs updated; new TargetMatchConditions field added with merge/list markers. |
Files not reviewed (1)
- api/policies.kyverno.io/v1alpha1/zz_generated.deepcopy.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
realshuting
force-pushed
the
feat/mpol-target-match-conditions
branch
from
July 16, 2026 08:56
fd5f792 to
2b0d363
Compare
Signed-off-by: realshuting <shuting@nirmata.com>
realshuting
force-pushed
the
feat/mpol-target-match-conditions
branch
from
July 16, 2026 09:02
2b0d363 to
e2d1708
Compare
5 of 8 tasks
JimBugwadia
approved these changes
Jul 16, 2026
This was referenced Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
targetMatchConditionstoMutatingPolicySpecThis is the API portion of kyverno/kyverno#16612. The Kyverno implementation will consume this field after the API dependency is updated.
Validation
go test ./api/policies.kyverno.io/v1alpha1 ./api/policies.kyverno.io/v1beta1make codegenis idempotent