1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/cmd/cli/kubectl-kyverno/_testdata/apply/test-1/policy.yaml
Charles-Edouard Brétéché 0688c9b369
fix: Kyverno apply produces false positives when validating 'empty dangling" tags (#8358)
* fix: verifyImages w/ multiple entries is not consistent

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* clean

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix: Kyverno apply produces false positives when validating 'empty dangling' tags

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-12 17:03:37 +00:00

28 lines
817 B
YAML

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: test-policy
annotations:
policies.kyverno.io/title: "Lol Security Standards"
policies.kyverno.io/category: "Lol Security Standards"
policies.kyverno.io/severity: "high"
policies.kyverno.io/subject: "Pod"
spec:
background: true
failurePolicy: Fail
rules:
- name: restrict-lol-annotation
match:
any:
- resources:
kinds:
- Pod
validate:
message: >-
If "lol" annotation is present then
its value can be only one of "such lol", "much annotation".
pattern:
# syntax refdoc: https://kyverno.io/docs/writing-policies/validate/#anchors
=(metadata):
=(annotations):
=(lol): such lol | much annotation