fix foreach

This commit is contained in:
2026-05-19 17:16:39 +07:00
parent e995770695
commit f980b651d9
11 changed files with 37 additions and 29 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ kubectl get clusterpolicy my-policy -o yaml | grep -A 10 "status:"
```bash
# Kyverno CLI — самый быстрый способ проверить
kyverno apply test-pols/policy-require-labels.yaml \
kyverno apply test-pols/ \
--resource test-deployment.yaml \
--detailed-results
@@ -18,11 +18,9 @@ spec:
kinds:
- Pod
validate:
message: "All containers must have resources.limits.cpu and resources.limits.memory."
foreach:
- list: "request.object.spec.containers"
message: >-
Container '{{ element.name }}' must have resources.limits.cpu
and resources.limits.memory defined.
pattern:
resources:
limits: