Kyverno
Hard
Testing
What does the 'kyverno test' command read to run policy tests?
Select your answer:
Show answer and explanation
Answer: kyverno-test.yaml files listing policies, resources and expected results
Explanation
'kyverno test <dir>' finds kyverno-test.yaml files, applies the listed policies to the listed resources without a cluster, and compares each rule's result (pass, fail or skip) with the expected one. Running it in CI catches policy regressions before they reach a cluster.
More hard Kyverno questions
- Why must background be set to false on a Kyverno policy whose rules use request.userInfo, such as the requesting user's name or roles?
- In recent Kyverno versions, where should you set Enforce or Audit for a validate rule?
- Kyverno 1.16 ships CEL-based policy types at API version v1beta1. Which one validates resources with CEL expressions, in the style of Kubernetes ValidatingAdmissionPolicy?
- What is the purpose of the 'context' field in a Kyverno policy?
- Which of the following is NOT a valid variable source in a Kyverno context?
- What is the purpose of the 'foreach' field in a Kyverno rule?