1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-12 02:46:56 +00:00
kyverno/test/conformance/chainsaw/mutate/existing/preconditions/policy.yaml
Charles-Edouard Brétéché d6933fff4f
chore: all chainsaw tests (#9011)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-24 11:17:58 +01:00

30 lines
742 B
YAML

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'