Skip to content

Commit

Permalink
fix(mutate): drop mention of the last-applied-patches annotation (#1442)
Browse files Browse the repository at this point in the history
The annotation has been dropped according to kyverno/kyverno#5164

Also, mention that by default Kyverno does not emit PolicyApplied events

Signed-off-by: Thomas P. <[email protected]>
  • Loading branch information
TPXP authored Dec 6, 2024
1 parent be7519f commit e931678
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions content/en/docs/writing-policies/mutate.md
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ spec:
keynew: "{{request.object.data.keyone}}-{{@}}"
```

Once a mutate existing policy is applied successfully, there will be an event and an annotation added to the target resource:
Once a mutate existing policy is applied successfully, an event can be emitted if `omitEvents` allows it (by default, Kyverno omits success and skipped events):

```sh
$ kubectl describe deploy foobar
Expand All @@ -728,15 +728,6 @@ Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal PolicyApplied 29s (x2 over 31s) kyverno-mutate policy add-sec/add-sec-rule applied
$ kubectl get deploy foobar -o yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
...
policies.kyverno.io/last-applied-patches: |
add-sec-rule.add-sec.kyverno.io: added /spec/template/spec/containers/0/securityContext
```

To troubleshoot policy application failure, inspect the `UpdateRequest` Custom Resource to get details. Successful `UpdateRequests` may be automatically cleaned up by Kyverno.
Expand Down

0 comments on commit e931678

Please sign in to comment.