1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 09:26:54 +00:00
kyverno/test/conformance/chainsaw/webhook-configurations/match-conditions-fail/policy.yaml
Khaled Emara f07007f864
fix(validate): custom match conditions errors (#11461)
* fix(validate): custom match conditions errors

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* test(webhook): failing match conditions

---------

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-11-05 11:59:09 +00:00

21 lines
494 B
YAML

apiVersion: kyverno.io/v2beta1
kind: ClusterPolicy
metadata:
name: refresh-env-var-in-pods
spec:
webhookConfiguration:
matchConditions:
- name: "exclude-managed-pod"
expression: '!("ownerReferences" in request.object.metadata.keys(@))'
rules:
- name: refresh-from-secret-env
match:
any:
- resources:
kinds:
- Secret
validate:
pattern:
metadata:
labels:
foo: bar