1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 18:06:55 +00:00
kyverno/test/conformance/kuttl/mutate/existing/preconditions/policy.yaml

31 lines
742 B
YAML
Raw Normal View History

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: test
spec:
mutateExistingOnPolicyUpdate: true
rules:
- name: test
match:
any:
- resources:
kinds:
- Namespace
names:
- default
mutate:
targets:
- kind: Pod
apiVersion: '*'
name: '*'
namespace: "{{ request.object.metadata.name }}"
preconditions:
all:
- key: "{{ target.metadata.annotations.\"policy.lan/value\" }}"
operator: Equals
value: foo
patchStrategicMerge:
metadata:
labels:
policy-applied: 'true'