Skip to content

Commit

Permalink
Merge pull request #38 from sergeiwaigant/feat(kube-vip)/toBool-helpe…
Browse files Browse the repository at this point in the history
…r-for-cp-enable-check

feat(kube-vip)/toBool-helper-for-cp-enable-check
  • Loading branch information
thebsdbox authored Jul 6, 2024
2 parents 3eec4fd + a44c7fb commit f9945e9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/kube-vip/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.1
version: 0.6.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
17 changes: 17 additions & 0 deletions charts/kube-vip/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,20 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Convert string to boolean
*/}}
{{- define "kube-vip.toBool" -}}
{{- if eq (lower (toString .)) "true" -}}
{{- true -}}
{{- else if eq (lower (toString .)) "false" -}}
{{- false -}}
{{- else if eq (lower (toString .)) "1" -}}
{{- true -}}
{{- else if eq (lower (toString .)) "0" -}}
{{- false -}}
{{- else -}}
{{- default . false -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/kube-vip/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
{{- end }}
{{- end }}
env:
{{- if eq .Values.env.cp_enable "true" }}
{{- if eq (include "kube-vip.toBool" .Values.env.cp_enable) "true" }}
- name: vip_address
value: {{ required "A valid config.address required!" .Values.config.address}}
{{- end }}
Expand Down

0 comments on commit f9945e9

Please sign in to comment.