Closed AlexanderBrevig closed 7 months ago
Currently the implementation in #3 used a workaround for programmatically setting default limits for CPU and memory.
Instead of an if checking cpuLimit and then doing this abomination: cpu: "{{ .Values.container.cpu | toString | replace "." "" | int64 | mul 500 }}m"
cpuLimit
cpu: "{{ .Values.container.cpu | toString | replace "." "" | int64 | mul 500 }}m"
We should be able to do this: cpu: {{ .Values.container.cpuLimit | default (mulf .Values.container.cpu * 5) }}
cpu: {{ .Values.container.cpuLimit | default (mulf .Values.container.cpu * 5) }}
Here's the breakdown of what my hack does: 0.1 -> "0.1" -> "01" -> 1 -> 500 -> "500m". Oh joy...
0.1 -> "0.1" -> "01" -> 1 -> 500 -> "500m"
We are currently blocked by Harness (waiting for 3.8 to be enabled by feature flag) and by https://github.com/vbehar/helm3-unittest/pull/11.
Currently the implementation in #3 used a workaround for programmatically setting default limits for CPU and memory.
Instead of an if checking
cpuLimit
and then doing this abomination:cpu: "{{ .Values.container.cpu | toString | replace "." "" | int64 | mul 500 }}m"
We should be able to do this:
cpu: {{ .Values.container.cpuLimit | default (mulf .Values.container.cpu * 5) }}
Here's the breakdown of what my hack does:
0.1 -> "0.1" -> "01" -> 1 -> 500 -> "500m"
. Oh joy...We are currently blocked by Harness (waiting for 3.8 to be enabled by feature flag) and by https://github.com/vbehar/helm3-unittest/pull/11.