2023-07-31 09:16:47 +00:00
|
|
|
{{- range $index, $middlewareData := .Values.middlewares.buffering }}
|
|
|
|
---
|
|
|
|
# Declaring the user list
|
|
|
|
apiVersion: traefik.io/v1alpha1
|
|
|
|
kind: Middleware
|
|
|
|
metadata:
|
|
|
|
name: {{ ternary (printf "%v-%v" $.Release.Name $middlewareData.name) $middlewareData.name $.Values.ingressClass.enabled }}
|
2023-07-31 10:32:04 +00:00
|
|
|
namespace: {{ $.Release.Namespace }}
|
2023-07-31 09:16:47 +00:00
|
|
|
spec:
|
|
|
|
buffering: {{/* Only render if its not <nil> and has a value of 0 or greater */}}
|
2023-10-27 18:56:39 +00:00
|
|
|
{{- if and (not (kindIs "invalid" $middlewareData.maxRequestBodyBytes)) (ge ($middlewareData.maxRequestBodyBytes | int) 0) }}
|
2023-07-31 09:16:47 +00:00
|
|
|
maxRequestBodyBytes: {{ $middlewareData.maxRequestBodyBytes }}
|
|
|
|
{{- end -}}
|
2023-10-27 18:56:39 +00:00
|
|
|
{{- if and (not (kindIs "invalid" $middlewareData.memRequestBodyBytes)) (ge ($middlewareData.memRequestBodyBytes | int) 0) }}
|
2023-07-31 09:16:47 +00:00
|
|
|
memRequestBodyBytes: {{ $middlewareData.memRequestBodyBytes }}
|
|
|
|
{{- end -}}
|
2023-10-27 18:56:39 +00:00
|
|
|
{{- if and (not (kindIs "invalid" $middlewareData.maxResponseBodyBytes)) (ge ($middlewareData.maxResponseBodyBytes | int) 0) }}
|
2023-07-31 09:16:47 +00:00
|
|
|
maxResponseBodyBytes: {{ $middlewareData.maxResponseBodyBytes }}
|
|
|
|
{{- end -}}
|
2023-10-27 18:56:39 +00:00
|
|
|
{{- if and (not (kindIs "invalid" $middlewareData.memResponseBodyBytes)) (ge ($middlewareData.memResponseBodyBytes | int) 0) }}
|
2023-07-31 09:16:47 +00:00
|
|
|
memResponseBodyBytes: {{ $middlewareData.memResponseBodyBytes }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if $middlewareData.retryExpression }}
|
|
|
|
retryExpression: {{ $middlewareData.retryExpression | quote }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|