1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/test/DaemonSet/policy-daemonset.yaml

29 lines
721 B
YAML

apiVersion: kyverno.io/v1alpha1
kind: ClusterPolicy
metadata:
name: policy-daemonset
spec:
rules:
- name: "Patch and Volume validation"
match:
resources:
kinds:
- DaemonSet
name: fluentd-elasticsearch
mutate:
patches:
- path: "/metadata/labels/isMutated"
op: add
value: "true"
- path: "/metadata/labels/originalLabel"
op: remove
validate:
message: "This daemonset is broken"
pattern:
spec:
template:
spec:
containers:
volumeMounts:
- name: varlibdockercontainers
readOnly: false