Skip to content

Commit

Permalink
fix(helm): satisfy helm lint
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
  • Loading branch information
michaelbeaumont committed Feb 28, 2023
1 parent 7d7845a commit 5046e38
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion deployments/charts/kuma/templates/cp-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,21 @@ spec:
limits:
{{- if .Values.controlPlane.resources.limits }}
{{ .Values.controlPlane.resources.limits | toYaml | nindent 14 }}
{{- else if and .Values.controlPlane.resources.requests .Values.controlPlane.resources.requests.memory }}
{{- else if .Values.controlPlane.resources.requests }}
{{- /*
This "double if" is necessary to satisfy the version of `helm lint` currently in use, v3.8.2.
With `if and`, it complains about `requests` being `nil` and the `requests.memory` check
because it doesn't understand the `requests` check eliminates `requests` being nil.
It can be collapsed into the outer "if" with Helm v3.11.1 at the latest.
*/}}
{{- if .Values.controlPlane.resources.requests.memory }}
memory: {{ .Values.controlPlane.resources.requests.memory }}
{{- else }}
memory: 256Mi
{{- end }}
{{- else }}
memory: 256Mi
{{- end }}
{{ with .Values.controlPlane.lifecycle }}
lifecycle: {{ . | toYaml | nindent 14 }}
{{ end }}
Expand Down

0 comments on commit 5046e38

Please sign in to comment.