Skip to content

Commit dfdde52

Browse files
committed
use ternary operator to show error if none bool value are used
Signed-off-by: AvivGuiser <[email protected]>
1 parent a3076f2 commit dfdde52

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

charts/kube-state-metrics/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ spec:
4242
{{ toYaml .Values.podAnnotations | nindent 8 }}
4343
{{- end }}
4444
spec:
45-
{{- if and (semverCompare ">=1.33-0" .Capabilities.KubeVersion.Version) (kindIs "bool" .Values.hostUsers) }}
46-
hostUsers: {{ .Values.hostUsers }}
45+
{{- if and (semverCompare ">=1.33-0" .Capabilities.KubeVersion.Version) (not (empty .Values.hostUsers)) }}
46+
hostUsers: {{ ternary "true" "false" .Values.hostUsers }}
4747
{{- end }}
4848
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
4949
hostNetwork: {{ .Values.hostNetwork }}

charts/kube-state-metrics/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extraArgs: []
5656
automountServiceAccountToken: true
5757

5858
# -- Use the host's user namespace available in kubernetes 1.33+.
59-
hostUsers: nil
59+
hostUsers:
6060

6161
service:
6262
port: 8080

0 commit comments

Comments
 (0)