Skip to content

Commit

Permalink
make fallbacks more granular
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-s committed Dec 20, 2024
1 parent 5c84c34 commit 300efaf
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions charts/rstudio-connect/files/job.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,32 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if any (ne (len $requests) 0) (ne (len $limits) 0) }}
{{- if or (ne (len $requests) 0) (ne (len $limits) 0) }}
resources:
{{- if ne (len $requests) 0 }}
requests:
{{- range $key, $val := $requests }}
{{ $key }}: {{ toYaml $val }}
{{- if $requests.cpu }}
cpu: {{ $requests.cpu }}
{{- else }}
cpu: 500m
{{- end }}
{{- if $requests.memory }}
memory: {{ $requests.memory }}
{{- else }}
memory: 1Gi
{{- end }}
{{- end }}
{{- if ne (len $limits) 0 }}
limits:
{{- range $key, $val := $limits }}
{{ $key }}: {{ toYaml $val }}
{{- if $limits.cpu }}
cpu: {{ $limits.cpu }}
{{- else }}
cpu: 500m
{{- end }}
{{- if $limits.memory }}
memory: {{ $limits.memory }}
{{- else }}
memory: 1Gi
{{- end }}
{{- end }}
{{- else }}
Expand Down

0 comments on commit 300efaf

Please sign in to comment.