1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/test/best_practices/require_labels.yaml
Charles-Edouard Brétéché 7562bea6db
chore: apply policy fixes (#8427)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-17 22:24:26 +00:00

22 lines
436 B
YAML

---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-labels
spec:
admission: true
background: true
rules:
- match:
any:
- resources:
kinds:
- Pod
name: check-for-labels
validate:
message: The label `app.kubernetes.io/name` is required.
pattern:
metadata:
labels:
app.kubernetes.io/name: ?*
validationFailureAction: Audit