1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 01:46:55 +00:00
kyverno/test/cli/test-mutate/foreach/cumulativePatch/policies.yaml
Jim Bugwadia 06e93fec46
apply patches cumulatively (#3083)
* apply patches cumulatively

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* handle skipped rules

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add test files

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2022-01-25 09:00:18 +00:00

26 lines
740 B
YAML

apiVersion : kyverno.io/v1
kind: ClusterPolicy
metadata:
name: add-default-resources
annotations:
pod-policies.kyverno.io/autogen-controllers: "none"
spec:
background: false
rules:
- name: add-default-requests
match:
resources:
kinds:
- Pod
mutate:
foreach:
- list: "request.object.spec.containers"
patchesJson6902: |-
- path: /spec/containers/{{elementIndex}}/resources/requests/memory
op: add
value: "100Mi"
- list: "request.object.spec.containers"
patchesJson6902: |-
- path: /spec/containers/{{elementIndex}}/resources/requests/cpu
op: add
value: "100m"