# Which of the following is a valid way to use a variable in a Kyverno policy pattern?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/which-of-the-following-is-a-valid-way-to-use-a-variable-in-a-kyverno-policy-pattern

- A. metadata.name: $(var1)
- B. metadata.name: {{var1}}
- C. metadata.name: {{ context.var1 }}
- D. metadata.name: ${var1}

**Answer:** metadata.name: {{var1}}

**Explanation:** Kyverno variables are JMESPath expressions in double braces. A context entry named var1 is referenced as {{var1}}, and request data as {{request.object.metadata.name}}. ${var1} is Flux and shell syntax, and $( ) in a pattern refers to another field of the same resource, not to a variable.
