Kyverno
Hard
Mutation
A Kyverno MutatingPolicy matches Pods, keeps the default autogen settings and uses a JSONPatch on /metadata/annotations. What happens in its Deployment variant?
Select your answer:
Show answer and explanation
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.
More hard Kyverno questions
- What is the purpose of the 'context' field in a Kyverno policy?
- What is the purpose of the 'foreach' field in a Kyverno rule?
- Which of the following is NOT a component of the Kyverno architecture?
- What is the purpose of the 'kyverno.io/updateToken' annotation in a generated resource?
- Which of the following is NOT a valid source for context variables in Kyverno?
- What is the purpose of the 'kyverno.io/last-applied-policy' annotation?