From b34f57e386092908d55c37d7bc2dab546653f7af Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Sun, 12 Sep 2021 22:10:48 +0200 Subject: [PATCH] fix: remove old configmap and secret references for VPN config/scripts --- charts/library/common/Chart.yaml | 2 +- .../common/templates/addons/vpn/_volume.tpl | 37 ------------------- .../common/templates/addons/vpn/_vpn.tpl | 13 +------ .../addons/vpn/openvpn/_container.tpl | 7 +--- .../addons/vpn/wireguard/_container.tpl | 7 +--- 5 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 charts/library/common/templates/addons/vpn/_volume.tpl diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index 4e9d29d65c8..3e8451e6861 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -18,4 +18,4 @@ maintainers: name: common sources: null type: library -version: 7.0.7 +version: 7.0.9 diff --git a/charts/library/common/templates/addons/vpn/_volume.tpl b/charts/library/common/templates/addons/vpn/_volume.tpl deleted file mode 100644 index 184e2a99488..00000000000 --- a/charts/library/common/templates/addons/vpn/_volume.tpl +++ /dev/null @@ -1,37 +0,0 @@ -{{/* -The volume (referencing VPN scripts) to be inserted into additionalVolumes. -*/}} -{{- define "common.addon.vpn.scriptsVolumeSpec" -}} -{{- if or .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down -}} -configMap: - name: {{ include "common.names.fullname" . }}-vpn - items: - {{- if .Values.addons.vpn.scripts.up }} - - key: up.sh - path: up.sh - mode: 0777 - {{- end }} - {{- if .Values.addons.vpn.scripts.down }} - - key: down.sh - path: down.sh - mode: 0777 - {{- end }} -{{- end -}} -{{- end -}} - -{{/* -The volume (referencing VPN config) to be inserted into additionalVolumes. -*/}} -{{- define "common.addon.vpn.configVolumeSpec" -}} -{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret -}} -secret: - {{- if .Values.addons.vpn.configFileSecret }} - secretName: {{ .Values.addons.vpn.configFileSecret }} - {{- else }} - secretName: {{ include "common.names.fullname" . }}-vpnconfig - {{- end }} - items: - - key: vpnConfigfile - path: vpnConfigfile -{{- end -}} -{{- end -}} diff --git a/charts/library/common/templates/addons/vpn/_vpn.tpl b/charts/library/common/templates/addons/vpn/_vpn.tpl index 5f537c6a015..bf261ddc561 100644 --- a/charts/library/common/templates/addons/vpn/_vpn.tpl +++ b/charts/library/common/templates/addons/vpn/_vpn.tpl @@ -18,19 +18,8 @@ It will include / inject the required templates based on the given values. {{- $configmap | nindent 0 -}} {{- end -}} - {{- $_ := set .Values.persistence "vpnConfig" .Values.addons.vpn.configFile -}} + {{- $_ := set .Values.persistence "vpnconfig" .Values.addons.vpn.configFile -}} - {{/* Append the vpn scripts volume to the volumes */}} - {{- $scriptVolume := include "common.addon.vpn.scriptsVolumeSpec" . | fromYaml -}} - {{- if $scriptVolume -}} - {{- $_ := set .Values.persistence "vpnscript" (dict "enabled" "true" "mountPath" "-" "type" "custom" "volumeSpec" $scriptVolume) -}} - {{- end -}} - - {{/* Append the vpn config volume to the volumes */}} - {{- $configVolume := include "common.addon.vpn.configVolumeSpec" . | fromYaml }} - {{ if $configVolume -}} - {{- $_ := set .Values.persistence "vpnconfig" (dict "enabled" "true" "mountPath" "-" "type" "custom" "volumeSpec" $configVolume) -}} - {{- end -}} {{- end -}} {{- end -}} diff --git a/charts/library/common/templates/addons/vpn/openvpn/_container.tpl b/charts/library/common/templates/addons/vpn/openvpn/_container.tpl index 6cf7d46b2dc..6c92ee8f060 100644 --- a/charts/library/common/templates/addons/vpn/openvpn/_container.tpl +++ b/charts/library/common/templates/addons/vpn/openvpn/_container.tpl @@ -37,12 +37,12 @@ envFrom: name: {{ include "common.names.fullname" . }}-openvpn {{- end }} {{- end }} -{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down .Values.addons.vpn.additionalVolumeMounts .Values.persistence.shared.enabled }} volumeMounts: + - mountPath: {{ .Values.persistence.shared.mountPath }} + name: shared {{- if or .Values.addons.vpn.configFile }} - name: vpnconfig mountPath: /vpn/vpn.conf - subPath: vpnConfigfile {{- end }} {{- if .Values.addons.vpn.scripts.up }} - name: vpnscript @@ -53,9 +53,6 @@ volumeMounts: - name: vpnscript mountPath: /vpn/down.sh subPath: down.sh -{{- end }} - - mountPath: {{ .Values.persistence.shared.mountPath }} - name: shared {{- end }} {{- with .Values.addons.vpn.livenessProbe }} livenessProbe: diff --git a/charts/library/common/templates/addons/vpn/wireguard/_container.tpl b/charts/library/common/templates/addons/vpn/wireguard/_container.tpl index f35cb744f35..ec4dd14cdc7 100644 --- a/charts/library/common/templates/addons/vpn/wireguard/_container.tpl +++ b/charts/library/common/templates/addons/vpn/wireguard/_container.tpl @@ -45,12 +45,12 @@ env: {{- end }} {{- end }} -{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down .Values.addons.vpn.additionalVolumeMounts .Values.persistence.shared.enabled }} volumeMounts: + - mountPath: {{ .Values.persistence.shared.mountPath }} + name: shared {{- if or .Values.addons.vpn.configFile }} - name: vpnconfig mountPath: /etc/wireguard/wg0.conf - subPath: vpnConfigfile {{- end }} {{- if .Values.addons.vpn.scripts.up }} - name: vpnscript @@ -61,9 +61,6 @@ volumeMounts: - name: vpnscript mountPath: /config/down.sh subPath: down.sh -{{- end }} - - mountPath: {{ .Values.persistence.shared.mountPath }} - name: shared {{- end }} {{- with .Values.addons.vpn.livenessProbe }} livenessProbe: