seperate setup and post-setup to prevent double setup runs on common chart

This commit is contained in:
kjeld Schouten-Lebbing
2021-10-10 00:02:33 +02:00
parent dd207168f7
commit 799baea4dc
15 changed files with 74 additions and 67 deletions
+1 -1
View File
@@ -23,4 +23,4 @@ volumeSpec:
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
+1 -1
View File
@@ -15,4 +15,4 @@ maintainers:
name: common
sources: null
type: library
version: 8.3.2
version: 8.3.3
+2 -54
View File
@@ -5,59 +5,7 @@ Main entrypoint for the common library chart. It will render all underlying temp
{{- /* Generate chart and dependency values */ -}}
{{- include "common.setup" . }}
{{- /* Enable code-server add-on if required */ -}}
{{- if .Values.addons.codeserver.enabled }}
{{- include "common.addon.codeserver" . }}
{{- end -}}
{{- /* Enable VPN add-on if required */ -}}
{{- if ne "disabled" .Values.addons.vpn.type -}}
{{- include "common.addon.vpn" . }}
{{- end -}}
{{- /* Enable promtail add-on if required */ -}}
{{- if .Values.addons.promtail.enabled }}
{{- include "common.addon.promtail" . }}
{{- end -}}
{{- /* Enable netshoot add-on if required */ -}}
{{- if .Values.addons.netshoot.enabled }}
{{- include "common.addon.netshoot" . }}
{{- end -}}
{{- /* Build the templates */ -}}
{{- include "common.pvc" . }}
{{- if .Values.serviceAccount.create -}}
{{- include "common.serviceAccount" . }}
{{- end -}}
{{- if .Values.controller.enabled }}
{{- if eq .Values.controller.type "deployment" }}
{{- include "common.deployment" . | nindent 0 }}
{{ else if eq .Values.controller.type "daemonset" }}
{{- include "common.daemonset" . | nindent 0 }}
{{ else if eq .Values.controller.type "statefulset" }}
{{- include "common.statefulset" . | nindent 0 }}
{{ else }}
{{- fail (printf "Not a valid controller.type (%s)" .Values.controller.type) }}
{{- end -}}
{{- end -}}
{{ include "common.rbac" . | nindent 0 }}
{{ include "common.hpa" . | nindent 0 }}
{{ include "common.service" . | nindent 0 }}
{{ include "common.ingress" . | nindent 0 }}
{{- if .Values.secret -}}
{{ include "common.secret" . | nindent 0 }}
{{- end -}}
{{ include "common.configmap.portal" . | nindent 0 }}
{{ include "common.networkpolicy" . | nindent 0 }}
{{- /* Generate remaining objects */ -}}
{{- include "common.postSetup" . }}
{{- end -}}
@@ -0,0 +1,59 @@
{{/*
Secondary entrypoint and primary loader for the common chart
*/}}
{{- define "common.postSetup" -}}
{{- /* Enable code-server add-on if required */ -}}
{{- if .Values.addons.codeserver.enabled }}
{{- include "common.addon.codeserver" . }}
{{- end -}}
{{- /* Enable VPN add-on if required */ -}}
{{- if ne "disabled" .Values.addons.vpn.type -}}
{{- include "common.addon.vpn" . }}
{{- end -}}
{{- /* Enable promtail add-on if required */ -}}
{{- if .Values.addons.promtail.enabled }}
{{- include "common.addon.promtail" . }}
{{- end -}}
{{- /* Enable netshoot add-on if required */ -}}
{{- if .Values.addons.netshoot.enabled }}
{{- include "common.addon.netshoot" . }}
{{- end -}}
{{- /* Build the templates */ -}}
{{- include "common.pvc" . }}
{{- if .Values.serviceAccount.create -}}
{{- include "common.serviceAccount" . }}
{{- end -}}
{{- if .Values.controller.enabled }}
{{- if eq .Values.controller.type "deployment" }}
{{- include "common.deployment" . | nindent 0 }}
{{ else if eq .Values.controller.type "daemonset" }}
{{- include "common.daemonset" . | nindent 0 }}
{{ else if eq .Values.controller.type "statefulset" }}
{{- include "common.statefulset" . | nindent 0 }}
{{ else }}
{{- fail (printf "Not a valid controller.type (%s)" .Values.controller.type) }}
{{- end -}}
{{- end -}}
{{ include "common.rbac" . | nindent 0 }}
{{ include "common.hpa" . | nindent 0 }}
{{ include "common.service" . | nindent 0 }}
{{ include "common.ingress" . | nindent 0 }}
{{- if .Values.secret -}}
{{ include "common.secret" . | nindent 0 }}
{{- end -}}
{{ include "common.configmap.portal" . | nindent 0 }}
{{ include "common.networkpolicy" . | nindent 0 }}
{{- end -}}
+1 -1
View File
@@ -69,4 +69,4 @@ volumeSpec:
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
@@ -2,4 +2,4 @@
{{- include "common.setup" . }}
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
@@ -2,4 +2,4 @@
{{- include "common.setup" . }}
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
+1 -1
View File
@@ -35,4 +35,4 @@ volumeSpec:
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
@@ -21,4 +21,4 @@ volumeSpec:
{{- $_ := set .Values.persistence "config-volume" (include "k8s-gateway.configvolume" . | fromYaml) -}}
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
@@ -2,7 +2,7 @@
{{- include "common.setup" . }}
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
{{/* Render configmap for littlelink */}}
{{- include "littlelink.configmap" . }}
@@ -14,4 +14,4 @@ volumeSpec:
{{- $_ := set .Values.persistence "mosquitto-config" (include "mosquitto.configVolume" . | fromYaml) -}}
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
@@ -14,4 +14,4 @@
{{- include "nextcloud.cronjob" . }}
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
+1 -1
View File
@@ -2,7 +2,7 @@
{{- include "common.setup" . }}
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
{{/* Render configmap for openldap */}}
{{- include "openldap.configmap" . }}
+1 -1
View File
@@ -5,4 +5,4 @@
{{- include "pihole.configmap" . }}
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}
+1 -1
View File
@@ -21,4 +21,4 @@
{{/* Render the templates */}}
{{ include "common.all" . }}
{{ include "common.postSetup" . }}