Skip to content

Commit 300efaf

Browse files
committed
make fallbacks more granular
1 parent 5c84c34 commit 300efaf

File tree

1 file changed

+19
-5
lines changed
  • charts/rstudio-connect/files

1 file changed

+19
-5
lines changed

charts/rstudio-connect/files/job.tpl

+19-5
Original file line numberDiff line numberDiff line change
@@ -267,18 +267,32 @@ spec:
267267
{{- end }}
268268
{{- end }}
269269
{{- end }}
270-
{{- if any (ne (len $requests) 0) (ne (len $limits) 0) }}
270+
{{- if or (ne (len $requests) 0) (ne (len $limits) 0) }}
271271
resources:
272272
{{- if ne (len $requests) 0 }}
273273
requests:
274-
{{- range $key, $val := $requests }}
275-
{{ $key }}: {{ toYaml $val }}
274+
{{- if $requests.cpu }}
275+
cpu: {{ $requests.cpu }}
276+
{{- else }}
277+
cpu: 500m
278+
{{- end }}
279+
{{- if $requests.memory }}
280+
memory: {{ $requests.memory }}
281+
{{- else }}
282+
memory: 1Gi
276283
{{- end }}
277284
{{- end }}
278285
{{- if ne (len $limits) 0 }}
279286
limits:
280-
{{- range $key, $val := $limits }}
281-
{{ $key }}: {{ toYaml $val }}
287+
{{- if $limits.cpu }}
288+
cpu: {{ $limits.cpu }}
289+
{{- else }}
290+
cpu: 500m
291+
{{- end }}
292+
{{- if $limits.memory }}
293+
memory: {{ $limits.memory }}
294+
{{- else }}
295+
memory: 1Gi
282296
{{- end }}
283297
{{- end }}
284298
{{- else }}

0 commit comments

Comments
 (0)