1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 09:56:55 +00:00
kyverno/test/conformance/chainsaw/mutate/e2e/jmespath-logic/03-policy-two.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

22 lines
564 B
YAML

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: mutate-policy
spec:
rules:
- name: gen-role
match:
any:
- resources:
kinds:
- ConfigMap
context:
- name: labelValue
apiCall:
urlPath: "/api/v1/namespaces/{{ request.object.metadata.namespace }}/configmaps"
jmesPath: "items[?metadata.name == 'source'].metadata.labels.\"kyverno.key/copy-me\" | [0]"
mutate:
patchStrategicMerge:
metadata:
labels:
+(kyverno.key/copy-me): "{{ labelValue }}"