# A Kyverno MutatingPolicy matches Pods, keeps the default autogen settings and uses a JSONPatch on /metadata/annotations. What happens in its Deployment variant?

Kyverno, Hard (Expert), Mutation. https://k8wiz.com/uquiz/a-kyverno-mutatingpolicy-matches-pods-keeps-the-default-autogen-settings-and-uses-a-jsonpatch-on-metadataannotations-what-happen

- A. Kyverno rewrites the path to /spec/template/metadata/annotations
- B. The path is copied unchanged, so it patches the Deployment itself
- C. Kyverno rejects the policy because JSONPatch can't be autogenerated
- D. The mutation is dropped and only ApplyConfiguration ones are kept

**Answer:** The path is copied unchanged, so it patches the Deployment itself

**Explanation:** Autogen rewrites object.spec and metadata label and annotation references in matchConditions and ApplyConfiguration expressions so they point at the Pod template. JSONPatch expressions are copied as written, so their paths still target the top-level object. Keep JSONPatch Pod mutations in a policy with autogen.podControllers.enabled set to false, or use ApplyConfiguration.
