1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 18:06:55 +00:00
kyverno/test/cli/test-mutate/foreach/cumulativePatch/policies.yaml
Charles-Edouard Brétéché 7562bea6db
chore: apply policy fixes (#8427)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-17 22:24:26 +00:00

30 lines
769 B
YAML

---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
annotations:
pod-policies.kyverno.io/autogen-controllers: none
name: add-default-resources
spec:
admission: true
background: false
rules:
- match:
any:
- 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"
name: add-default-requests
validationFailureAction: Audit