(fix) simplify and correct openvpn VPN_AUTH envvar generation

This commit is contained in:
kjeld Schouten-Lebbing
2021-09-29 17:32:24 +02:00
parent e1ffb00eba
commit 7600caaba0
3 changed files with 3 additions and 9 deletions

View File

@@ -15,4 +15,4 @@ maintainers:
name: common
sources: null
type: library
version: 8.0.12
version: 8.0.13

View File

@@ -49,7 +49,7 @@ env:
{{- end }}
{{- end }}
{{- if or .Values.addons.vpn.openvpn.auth }}
{{- if or ( .Values.addons.vpn.openvpn.username ) ( .Values.addons.vpn.openvpn.password ) }}
envFrom:
- secretRef:
name: {{ include "common.names.fullname" . }}-openvpn

View File

@@ -10,11 +10,5 @@ metadata:
labels:
{{- include "common.labels" $ | nindent 4 }}
data:
{{- $vpnauth := "" }}
{{- if .Values.addons.vpn.openvpn.username }}
{{- $vpnauth = ( printf "%v;%v" .Values.addons.vpn.openvpn.username .Values.addons.vpn.openvpn.password ) }}
{{- else }}
{{- $vpnauth = .Values.addons.vpn.openvpn.password }}
{{- end }}
VPN_AUTH: {{ $vpnauth | b64enc }}
VPN_AUTH: {{ ( printf "%v;%v" .Values.addons.vpn.openvpn.username .Values.addons.vpn.openvpn.password ) | b64enc }}
{{- end -}}