From 804f80cff77a662f8baa221e91406282bdbd22b3 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Fri, 13 Sep 2024 16:06:08 -0400 Subject: [PATCH 01/20] Add existingClaim option to the individual PVC --- mailu/templates/_claims.tpl | 14 +++++++------- mailu/templates/admin/pvc.yaml | 2 +- mailu/templates/dovecot/pvc.yaml | 2 +- mailu/templates/fetchmail/pvc.yaml | 2 +- mailu/templates/postfix/pvc.yaml | 2 +- mailu/templates/rspamd/pvc.yaml | 2 +- mailu/templates/webdav/pvc.yaml | 2 +- mailu/templates/webmail/pvc.yaml | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mailu/templates/_claims.tpl b/mailu/templates/_claims.tpl index 62b57cc3..a5cba222 100644 --- a/mailu/templates/_claims.tpl +++ b/mailu/templates/_claims.tpl @@ -1,34 +1,34 @@ {{/* Admin pod persistent volume claim name */}} {{ define "mailu.admin.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.admin.persistence.claimNameOverride | default (printf "%s-admin" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | .Values.admin.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.admin.persistence.claimNameOverride | default (printf "%s-admin" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Dovecot pod persistent volume claim name */}} {{ define "mailu.dovecot.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.claimNameOverride | default (printf "%s-dovecot" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | .Values.dovecot.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.claimNameOverride | default (printf "%s-dovecot" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Postfix pod persistent volume claim name */}} {{ define "mailu.postfix.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.postfix.persistence.claimNameOverride | default (printf "%s-postfix" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | .Values.postfix.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.postfix.persistence.claimNameOverride | default (printf "%s-postfix" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Rspamd pod persistent volume claim name */}} {{ define "mailu.rspamd.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.claimNameOverride | default (printf "%s-rspamd" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | .Values.rspamd.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.claimNameOverride | default (printf "%s-rspamd" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Roundcube pod persistent volume claim name */}} {{ define "mailu.webmail.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.webmail.persistence.claimNameOverride | default (printf "%s-webmail" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | .Values.webmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webmail.persistence.claimNameOverride | default (printf "%s-webmail" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Fetchmail pod persistent volume claim name */}} {{ define "mailu.fetchmail.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.claimNameOverride | default (printf "%s-fetchmail" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | .Values.fetchmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.claimNameOverride | default (printf "%s-fetchmail" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Webdav pod persistent volume claim name */}} {{ define "mailu.webdav.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.webdav.persistence.claimNameOverride | default (printf "%s-webdav" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | .Values.webdav.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webdav.persistence.claimNameOverride | default (printf "%s-webdav" (include "mailu.fullname" .)) -}} {{- end -}} diff --git a/mailu/templates/admin/pvc.yaml b/mailu/templates/admin/pvc.yaml index 99840226..8e79cd1c 100644 --- a/mailu/templates/admin/pvc.yaml +++ b/mailu/templates/admin/pvc.yaml @@ -1,5 +1,5 @@ --- -{{- if not .Values.persistence.single_pvc }} +{{- if and (not .Values.persistence.single_pvc) (not .Values.admin.persistence.existingClaim)}} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/mailu/templates/dovecot/pvc.yaml b/mailu/templates/dovecot/pvc.yaml index e3663f1e..0752f9d6 100644 --- a/mailu/templates/dovecot/pvc.yaml +++ b/mailu/templates/dovecot/pvc.yaml @@ -1,6 +1,6 @@ --- {{- if .Values.dovecot.enabled }} -{{- if not .Values.persistence.single_pvc }} +{{- if and (not .Values.persistence.single_pvc) (not .Values.postfix.persistence.existingClaim)}} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/mailu/templates/fetchmail/pvc.yaml b/mailu/templates/fetchmail/pvc.yaml index 4cc16a59..a1358fcd 100644 --- a/mailu/templates/fetchmail/pvc.yaml +++ b/mailu/templates/fetchmail/pvc.yaml @@ -1,5 +1,5 @@ --- -{{- if and (.Values.fetchmail.enabled) (not .Values.persistence.single_pvc) }} +{{- if and (.Values.fetchmail.enabled) (not .Values.persistence.single_pvc) (not .Values.fetchmail.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/mailu/templates/postfix/pvc.yaml b/mailu/templates/postfix/pvc.yaml index 1d02e0a6..29eb1706 100644 --- a/mailu/templates/postfix/pvc.yaml +++ b/mailu/templates/postfix/pvc.yaml @@ -1,5 +1,5 @@ --- -{{- if not .Values.persistence.single_pvc }} +{{- if and (not .Values.persistence.single_pvc) (not .Values.postfix.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/mailu/templates/rspamd/pvc.yaml b/mailu/templates/rspamd/pvc.yaml index 32e82dac..f8a220c9 100644 --- a/mailu/templates/rspamd/pvc.yaml +++ b/mailu/templates/rspamd/pvc.yaml @@ -1,5 +1,5 @@ --- -{{- if and (not .Values.persistence.single_pvc) .Values.rspamd.enabled }} +{{- if and (not .Values.persistence.single_pvc)(not .Values.rspamd.persistence.existingClaim) .Values.rspamd.enabled }} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/mailu/templates/webdav/pvc.yaml b/mailu/templates/webdav/pvc.yaml index 1af159ad..9baa6cf7 100644 --- a/mailu/templates/webdav/pvc.yaml +++ b/mailu/templates/webdav/pvc.yaml @@ -1,5 +1,5 @@ --- -{{- if and (.Values.webdav.enabled) (not .Values.persistence.single_pvc) }} +{{- if and (.Values.webdav.enabled) (not .Values.persistence.single_pvc) (not .Values.webdav.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/mailu/templates/webmail/pvc.yaml b/mailu/templates/webmail/pvc.yaml index bed6414b..e17ab428 100644 --- a/mailu/templates/webmail/pvc.yaml +++ b/mailu/templates/webmail/pvc.yaml @@ -1,5 +1,5 @@ --- -{{- if and (.Values.webmail.enabled) (not .Values.persistence.single_pvc) }} +{{- if and (.Values.webmail.enabled) (not .Values.persistence.single_pvc) (not .Values.webmail.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: From 4471e5e1cb1c1b063b18b06a8d4c1db2f661344d Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 07:48:53 -0400 Subject: [PATCH 02/20] fix parens --- mailu/templates/rspamd/pvc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailu/templates/rspamd/pvc.yaml b/mailu/templates/rspamd/pvc.yaml index f8a220c9..85a53a69 100644 --- a/mailu/templates/rspamd/pvc.yaml +++ b/mailu/templates/rspamd/pvc.yaml @@ -1,5 +1,5 @@ --- -{{- if and (not .Values.persistence.single_pvc)(not .Values.rspamd.persistence.existingClaim) .Values.rspamd.enabled }} +{{- if and (not .Values.persistence.single_pvc)(not .Values.rspamd.persistence.existingClaim) (.Values.rspamd.enabled) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: From aebaf2a13be86312199542741e28eb702b6458e1 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 07:50:57 -0400 Subject: [PATCH 03/20] spacing --- mailu/templates/rspamd/pvc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailu/templates/rspamd/pvc.yaml b/mailu/templates/rspamd/pvc.yaml index 85a53a69..06e2f9db 100644 --- a/mailu/templates/rspamd/pvc.yaml +++ b/mailu/templates/rspamd/pvc.yaml @@ -1,5 +1,5 @@ --- -{{- if and (not .Values.persistence.single_pvc)(not .Values.rspamd.persistence.existingClaim) (.Values.rspamd.enabled) }} +{{- if and (not .Values.persistence.single_pvc) (not .Values.rspamd.persistence.existingClaim) (.Values.rspamd.enabled) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: From 393b29f7ab21dbbca43ab972be9e5a50c986a2ce Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 07:57:44 -0400 Subject: [PATCH 04/20] reduce and statement --- mailu/templates/rspamd/pvc.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mailu/templates/rspamd/pvc.yaml b/mailu/templates/rspamd/pvc.yaml index 06e2f9db..6f4570d3 100644 --- a/mailu/templates/rspamd/pvc.yaml +++ b/mailu/templates/rspamd/pvc.yaml @@ -1,5 +1,6 @@ --- -{{- if and (not .Values.persistence.single_pvc) (not .Values.rspamd.persistence.existingClaim) (.Values.rspamd.enabled) }} +{{- if .Values.rspamd.enabled -}} +{{- if and (not .Values.persistence.single_pvc) (not .Values.rspamd.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: @@ -31,3 +32,4 @@ spec: storageClassName: {{ .Values.rspamd.persistence.storageClass }} {{- end }} {{- end }} +{{- end }} From b81086f16e341ffe6d62c2492f34e18b2dd1b4c6 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 08:01:42 -0400 Subject: [PATCH 05/20] fix if logic --- mailu/templates/fetchmail/pvc.yaml | 4 +++- mailu/templates/webdav/pvc.yaml | 4 +++- mailu/templates/webmail/pvc.yaml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mailu/templates/fetchmail/pvc.yaml b/mailu/templates/fetchmail/pvc.yaml index a1358fcd..b4308627 100644 --- a/mailu/templates/fetchmail/pvc.yaml +++ b/mailu/templates/fetchmail/pvc.yaml @@ -1,5 +1,6 @@ --- -{{- if and (.Values.fetchmail.enabled) (not .Values.persistence.single_pvc) (not .Values.fetchmail.persistence.existingClaim) }} +{{- if .Values.fetchmail.enabled -}} +{{- if and (not .Values.persistence.single_pvc) (not .Values.fetchmail.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: @@ -31,3 +32,4 @@ spec: storageClassName: {{ .Values.fetchmail.persistence.storageClass }} {{- end }} {{- end }} +{{- end }} diff --git a/mailu/templates/webdav/pvc.yaml b/mailu/templates/webdav/pvc.yaml index 9baa6cf7..50e568f0 100644 --- a/mailu/templates/webdav/pvc.yaml +++ b/mailu/templates/webdav/pvc.yaml @@ -1,5 +1,6 @@ --- -{{- if and (.Values.webdav.enabled) (not .Values.persistence.single_pvc) (not .Values.webdav.persistence.existingClaim) }} +{{- if .Values.webdav.enabled -}} +{{- if and (not .Values.persistence.single_pvc) (not .Values.webdav.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: @@ -31,3 +32,4 @@ spec: storageClassName: {{ .Values.webdav.persistence.storageClass }} {{- end }} {{- end }} +{{- end }} diff --git a/mailu/templates/webmail/pvc.yaml b/mailu/templates/webmail/pvc.yaml index e17ab428..6789c0e6 100644 --- a/mailu/templates/webmail/pvc.yaml +++ b/mailu/templates/webmail/pvc.yaml @@ -1,5 +1,6 @@ --- -{{- if and (.Values.webmail.enabled) (not .Values.persistence.single_pvc) (not .Values.webmail.persistence.existingClaim) }} +{{- if .Values.webmail.enabled -}} +{{- if and (not .Values.persistence.single_pvc) (not .Values.webmail.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: @@ -31,3 +32,4 @@ spec: storageClassName: {{ .Values.webmail.persistence.storageClass }} {{- end }} {{- end }} +{{- end }} From 5e0632acbec0da1d1ef0dc1d06d0f62580dd7a25 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 08:17:09 -0400 Subject: [PATCH 06/20] add missing operator --- mailu/templates/_claims.tpl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mailu/templates/_claims.tpl b/mailu/templates/_claims.tpl index a5cba222..0fb03ebc 100644 --- a/mailu/templates/_claims.tpl +++ b/mailu/templates/_claims.tpl @@ -1,34 +1,34 @@ {{/* Admin pod persistent volume claim name */}} {{ define "mailu.admin.claimName" }} -{{- .Values.persistence.single_pvc | .Values.admin.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.admin.persistence.claimNameOverride | default (printf "%s-admin" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.admin.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.admin.persistence.claimNameOverride | default (printf "%s-admin" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Dovecot pod persistent volume claim name */}} {{ define "mailu.dovecot.claimName" }} -{{- .Values.persistence.single_pvc | .Values.dovecot.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.claimNameOverride | default (printf "%s-dovecot" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.dovecot.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.claimNameOverride | default (printf "%s-dovecot" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Postfix pod persistent volume claim name */}} {{ define "mailu.postfix.claimName" }} -{{- .Values.persistence.single_pvc | .Values.postfix.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.postfix.persistence.claimNameOverride | default (printf "%s-postfix" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.postfix.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.postfix.persistence.claimNameOverride | default (printf "%s-postfix" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Rspamd pod persistent volume claim name */}} {{ define "mailu.rspamd.claimName" }} -{{- .Values.persistence.single_pvc | .Values.rspamd.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.claimNameOverride | default (printf "%s-rspamd" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.rspamd.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.claimNameOverride | default (printf "%s-rspamd" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Roundcube pod persistent volume claim name */}} {{ define "mailu.webmail.claimName" }} -{{- .Values.persistence.single_pvc | .Values.webmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webmail.persistence.claimNameOverride | default (printf "%s-webmail" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.webmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webmail.persistence.claimNameOverride | default (printf "%s-webmail" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Fetchmail pod persistent volume claim name */}} {{ define "mailu.fetchmail.claimName" }} -{{- .Values.persistence.single_pvc | .Values.fetchmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.claimNameOverride | default (printf "%s-fetchmail" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.fetchmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.claimNameOverride | default (printf "%s-fetchmail" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Webdav pod persistent volume claim name */}} {{ define "mailu.webdav.claimName" }} -{{- .Values.persistence.single_pvc | .Values.webdav.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webdav.persistence.claimNameOverride | default (printf "%s-webdav" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.webdav.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webdav.persistence.claimNameOverride | default (printf "%s-webdav" (include "mailu.fullname" .)) -}} {{- end -}} From be7395668779eb9f5ff97a4bea2d04cacd6bbb67 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 08:21:50 -0400 Subject: [PATCH 07/20] fix syntax issue --- mailu/templates/_claims.tpl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mailu/templates/_claims.tpl b/mailu/templates/_claims.tpl index 0fb03ebc..7c0b7868 100644 --- a/mailu/templates/_claims.tpl +++ b/mailu/templates/_claims.tpl @@ -1,34 +1,34 @@ {{/* Admin pod persistent volume claim name */}} {{ define "mailu.admin.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.admin.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.admin.persistence.claimNameOverride | default (printf "%s-admin" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.admin.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.admin.persistence.claimNameOverride | default (printf "%s-admin" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Dovecot pod persistent volume claim name */}} {{ define "mailu.dovecot.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.dovecot.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.claimNameOverride | default (printf "%s-dovecot" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.claimNameOverride | default (printf "%s-dovecot" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Postfix pod persistent volume claim name */}} {{ define "mailu.postfix.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.postfix.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.postfix.persistence.claimNameOverride | default (printf "%s-postfix" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.postfix.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.postfix.persistence.claimNameOverride | default (printf "%s-postfix" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Rspamd pod persistent volume claim name */}} {{ define "mailu.rspamd.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.rspamd.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.claimNameOverride | default (printf "%s-rspamd" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.claimNameOverride | default (printf "%s-rspamd" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Roundcube pod persistent volume claim name */}} {{ define "mailu.webmail.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.webmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webmail.persistence.claimNameOverride | default (printf "%s-webmail" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.webmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webmail.persistence.claimNameOverride | default (printf "%s-webmail" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Fetchmail pod persistent volume claim name */}} {{ define "mailu.fetchmail.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.fetchmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.claimNameOverride | default (printf "%s-fetchmail" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.claimNameOverride | default (printf "%s-fetchmail" (include "mailu.fullname" .)) -}} {{- end -}} {{/* Webdav pod persistent volume claim name */}} {{ define "mailu.webdav.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName") .Values.webdav.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webdav.persistence.claimNameOverride | default (printf "%s-webdav" (include "mailu.fullname" .)) -}} +{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.webdav.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webdav.persistence.claimNameOverride | default (printf "%s-webdav" (include "mailu.fullname" .)) -}} {{- end -}} From 0a7bfd0b21f41e5513a057bd6ac9220016002a23 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 08:36:37 -0400 Subject: [PATCH 08/20] change logic method for claims --- mailu/templates/_claims.tpl | 70 +++++++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/mailu/templates/_claims.tpl b/mailu/templates/_claims.tpl index 7c0b7868..b281db90 100644 --- a/mailu/templates/_claims.tpl +++ b/mailu/templates/_claims.tpl @@ -1,34 +1,90 @@ {{/* Admin pod persistent volume claim name */}} {{ define "mailu.admin.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.admin.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.admin.persistence.claimNameOverride | default (printf "%s-admin" (include "mailu.fullname" .)) -}} +{{- if .Values.persistence.single_pvc -}} +{{- (include "mailu.claimName" .) -}} +{{- else if .Values.admin.persistence.existingClaim -}} +{{- .Values.admin.persistence.existingClaim -}} +{{- else if .Values.admin.persistence.claimNameOverride -}} +{{- .Values.admin.persistence.claimNameOverride -}} +{{- else -}} +{{ printf "%s-admin" (include "mailu.fullname" .) }} +{{- end -}} {{- end -}} {{/* Dovecot pod persistent volume claim name */}} {{ define "mailu.dovecot.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.claimNameOverride | default (printf "%s-dovecot" (include "mailu.fullname" .)) -}} +{{- if .Values.persistence.single_pvc -}} +{{- (include "mailu.claimName" .) -}} +{{- else if .Values.dovecot.persistence.existingClaim -}} +{{- .Values.dovecot.persistence.existingClaim -}} +{{- else if .Values.dovecot.persistence.claimNameOverride -}} +{{- .Values.dovecot.persistence.claimNameOverride -}} +{{- else -}} +{{ printf "%s-dovecot" (include "mailu.fullname" .) }} +{{- end -}} {{- end -}} {{/* Postfix pod persistent volume claim name */}} {{ define "mailu.postfix.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.postfix.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.postfix.persistence.claimNameOverride | default (printf "%s-postfix" (include "mailu.fullname" .)) -}} +{{- if .Values.persistence.single_pvc -}} +{{- (include "mailu.claimName" .) -}} +{{- else if .Values.postfix.persistence.existingClaim -}} +{{- .Values.postfix.persistence.existingClaim -}} +{{- else if .Values.postfix.persistence.claimNameOverride -}} +{{- .Values.postfix.persistence.claimNameOverride -}} +{{- else -}} +{{ printf "%s-postfix" (include "mailu.fullname" .) }} +{{- end -}} {{- end -}} {{/* Rspamd pod persistent volume claim name */}} {{ define "mailu.rspamd.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.claimNameOverride | default (printf "%s-rspamd" (include "mailu.fullname" .)) -}} +{{- if .Values.persistence.single_pvc -}} +{{- (include "mailu.claimName" .) -}} +{{- else if .Values.rspamd.persistence.existingClaim -}} +{{- .Values.rspamd.persistence.existingClaim -}} +{{- else if .Values.rspamd.persistence.claimNameOverride -}} +{{- .Values.rspamd.persistence.claimNameOverride -}} +{{- else -}} +{{ printf "%s-rspamd" (include "mailu.fullname" .) }} +{{- end -}} {{- end -}} {{/* Roundcube pod persistent volume claim name */}} {{ define "mailu.webmail.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.webmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webmail.persistence.claimNameOverride | default (printf "%s-webmail" (include "mailu.fullname" .)) -}} +{{- if .Values.persistence.single_pvc -}} +{{- (include "mailu.claimName" .) -}} +{{- else if .Values.webmail.persistence.existingClaim -}} +{{- .Values.webmail.persistence.existingClaim -}} +{{- else if .Values.webmail.persistence.claimNameOverride -}} +{{- .Values.webmail.persistence.claimNameOverride -}} +{{- else -}} +{{ printf "%s-webmail" (include "mailu.fullname" .) }} +{{- end -}} {{- end -}} {{/* Fetchmail pod persistent volume claim name */}} {{ define "mailu.fetchmail.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.claimNameOverride | default (printf "%s-fetchmail" (include "mailu.fullname" .)) -}} +{{- if .Values.persistence.single_pvc -}} +{{- (include "mailu.claimName" .) -}} +{{- else if .Values.fetchmail.persistence.existingClaim -}} +{{- .Values.fetchmail.persistence.existingClaim -}} +{{- else if .Values.fetchmail.persistence.claimNameOverride -}} +{{- .Values.fetchmail.persistence.claimNameOverride -}} +{{- else -}} +{{ printf "%s-fetchmail" (include "mailu.fullname" .) }} +{{- end -}} {{- end -}} {{/* Webdav pod persistent volume claim name */}} {{ define "mailu.webdav.claimName" }} -{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.webdav.persistence.existingClaim | ternary (include "mailu.claimName" .) .Values.webdav.persistence.claimNameOverride | default (printf "%s-webdav" (include "mailu.fullname" .)) -}} +{{- if .Values.persistence.single_pvc -}} +{{- (include "mailu.claimName" .) -}} +{{- else if .Values.webdav.persistence.existingClaim -}} +{{- .Values.webdav.persistence.existingClaim -}} +{{- else if .Values.webdav.persistence.claimNameOverride -}} +{{- .Values.webdav.persistence.claimNameOverride -}} +{{- else -}} +{{ printf "%s-webdav" (include "mailu.fullname" .) }} +{{- end -}} {{- end -}} From e39b0869933f490b674f2bf91519974b90dfe17e Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 08:55:18 -0400 Subject: [PATCH 09/20] hardcode the repo and tag --- .github/workflows/publish-chart.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index 9e3365de..e9d14bb6 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -63,9 +63,9 @@ jobs: uses: octokit/request-action@v2.x id: get_release with: - route: GET /repos/{repo}/releases/tags/{tag} - repo: ${{ github.repository }} - tag: ${{ github.event.inputs.package }}-${{ github.event.inputs.version }} + route: GET /repos/hagak/helm-charts/releases/tags/mailu-v2.2.0 + # repo: ${{ github.repository }} + # tag: ${{ github.event.inputs.package }}-${{ github.event.inputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 238128c161d181e342ea988c4d814c1a2ab1e003 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 08:59:15 -0400 Subject: [PATCH 10/20] update --- .github/workflows/publish-chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index e9d14bb6..a4f7a180 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -63,7 +63,7 @@ jobs: uses: octokit/request-action@v2.x id: get_release with: - route: GET /repos/hagak/helm-charts/releases/tags/mailu-v2.2.0 + route: GET /hagak/helm-charts/releases/tag/v2.2.0 # repo: ${{ github.repository }} # tag: ${{ github.event.inputs.package }}-${{ github.event.inputs.version }} env: From 3b86f01ef4b6f4214688aa2f27e5427bcad9537d Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 09:01:13 -0400 Subject: [PATCH 11/20] revert --- .github/workflows/publish-chart.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index a4f7a180..9e3365de 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -63,9 +63,9 @@ jobs: uses: octokit/request-action@v2.x id: get_release with: - route: GET /hagak/helm-charts/releases/tag/v2.2.0 - # repo: ${{ github.repository }} - # tag: ${{ github.event.inputs.package }}-${{ github.event.inputs.version }} + route: GET /repos/{repo}/releases/tags/{tag} + repo: ${{ github.repository }} + tag: ${{ github.event.inputs.package }}-${{ github.event.inputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a3e3443bc69a040849aff22d62af5575e3b07920 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 09:06:20 -0400 Subject: [PATCH 12/20] remove package from tag --- .github/workflows/publish-chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index 9e3365de..d20e49eb 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -65,7 +65,7 @@ jobs: with: route: GET /repos/{repo}/releases/tags/{tag} repo: ${{ github.repository }} - tag: ${{ github.event.inputs.package }}-${{ github.event.inputs.version }} + tag: ${{ github.event.inputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 478190cda8bee9d8ae0e2b6aaefbdb11d0fc315a Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 09:15:28 -0400 Subject: [PATCH 13/20] change name --- .github/workflows/publish-chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index d20e49eb..fde90caa 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -84,7 +84,7 @@ jobs: git config --global user.email "actions@github.com" git config --global user.name "Github actions" REPO_NAME=$(echo "${{ github.repository }}" | cut -d "/" -f 2) - cr -t $GITHUB_TOKEN index -o ${{ github.repository_owner }} -r ${REPO_NAME} -i gh-pages/index.yaml --release-name-template "{{ .Name }}-{{ .Version }}" + cr -t $GITHUB_TOKEN index -o ${{ github.repository_owner }} -r ${REPO_NAME} -i gh-pages/index.yaml --release-name-template "{{ .Version }}" cd gh-pages git add . git commit -m "New Chart Release for ${{ github.event.inputs.package }}: ${{ github.event.inputs.version }}" From 106e01f6cd30bc44975366bbee53564c4d0fb22d Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 09:32:29 -0400 Subject: [PATCH 14/20] revert --- .github/workflows/publish-chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index fde90caa..9e3365de 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -65,7 +65,7 @@ jobs: with: route: GET /repos/{repo}/releases/tags/{tag} repo: ${{ github.repository }} - tag: ${{ github.event.inputs.version }} + tag: ${{ github.event.inputs.package }}-${{ github.event.inputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -84,7 +84,7 @@ jobs: git config --global user.email "actions@github.com" git config --global user.name "Github actions" REPO_NAME=$(echo "${{ github.repository }}" | cut -d "/" -f 2) - cr -t $GITHUB_TOKEN index -o ${{ github.repository_owner }} -r ${REPO_NAME} -i gh-pages/index.yaml --release-name-template "{{ .Version }}" + cr -t $GITHUB_TOKEN index -o ${{ github.repository_owner }} -r ${REPO_NAME} -i gh-pages/index.yaml --release-name-template "{{ .Name }}-{{ .Version }}" cd gh-pages git add . git commit -m "New Chart Release for ${{ github.event.inputs.package }}: ${{ github.event.inputs.version }}" From 3bd7124a25c29c70b2410bfe339aaba57b43f05e Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 09:38:43 -0400 Subject: [PATCH 15/20] update --- .release-please-manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 191ef497..36d99108 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - "mailu": "2.1.1" + "mailu": "2.2.0" } From 35c44d0e366fb3aea6494588ac3bab5098197aa0 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 09:40:52 -0400 Subject: [PATCH 16/20] update --- mailu/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailu/Chart.yaml b/mailu/Chart.yaml index 47596ba7..152207e9 100644 --- a/mailu/Chart.yaml +++ b/mailu/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 appVersion: 2024.06.10 -version: 2.1.1 +version: 2.2.0 name: mailu description: This chart installs the Mailu mail system on kubernetes home: https://mailu.io From 983ddc138c264be4443530abb9344670c1766c60 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sat, 14 Sep 2024 09:42:54 -0400 Subject: [PATCH 17/20] try this wway --- mailu/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailu/Chart.yaml b/mailu/Chart.yaml index 152207e9..3b15ef4f 100644 --- a/mailu/Chart.yaml +++ b/mailu/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 appVersion: 2024.06.10 -version: 2.2.0 +version: v2.2.0 name: mailu description: This chart installs the Mailu mail system on kubernetes home: https://mailu.io From f6ed4f7b05c74f6a54f13f06723e10f0d84a2d66 Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Sun, 15 Sep 2024 09:44:44 -0400 Subject: [PATCH 18/20] revert chart changes --- .release-please-manifest.json | 2 +- mailu/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 36d99108..191ef497 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - "mailu": "2.2.0" + "mailu": "2.1.1" } diff --git a/mailu/Chart.yaml b/mailu/Chart.yaml index 3b15ef4f..47596ba7 100644 --- a/mailu/Chart.yaml +++ b/mailu/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 appVersion: 2024.06.10 -version: v2.2.0 +version: 2.1.1 name: mailu description: This chart installs the Mailu mail system on kubernetes home: https://mailu.io From 6dbd13db95e80039bd10a6b4b9c929177c66a737 Mon Sep 17 00:00:00 2001 From: hagak <9702199+hagak@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:42:52 -0500 Subject: [PATCH 19/20] Remove Notify publish-chart.yaml --- .github/workflows/publish-chart.yaml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index 9e3365de..08dfc4c5 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -92,23 +92,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - notify-matrix: - needs: - - publish - runs-on: ubuntu-latest - name: Send message via Matrix - steps: - - name: Send message to mailu-helm-chart channel - # Only run this job if the release-please job created a release - id: matrix-chat-message - uses: fadenb/matrix-chat-message@v0.0.6 - with: - homeserver: "matrix.org" - token: ${{ secrets.MATRIX_TOKEN }} - channel: "!KluZWhQwHDYrOfqJdD:make-it.fr" - message: | - # New release of ${{ github.event.inputs.package }} helm chart: ${{ github.event.inputs.version }} - - [${{ github.event.inputs.version }}](https://github.com/${{ github.repository }}/releases/tag/${{ github.event.inputs.package }}-${{ github.event.inputs.version }}) has been released. - - ${{ needs.publish.outputs.release_body }} + From 85a9e62e649222a46d11401ae4e6abaeb2cfd46f Mon Sep 17 00:00:00 2001 From: Jeffrey Gordon Date: Mon, 23 Dec 2024 16:48:38 -0500 Subject: [PATCH 20/20] update values.yaml with new existingClaim option --- mailu/values.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mailu/values.yaml b/mailu/values.yaml index 91f44f07..dfb64b5b 100644 --- a/mailu/values.yaml +++ b/mailu/values.yaml @@ -915,6 +915,7 @@ admin: accessModes: [ReadWriteOnce] claimNameOverride: "" annotations: {} + existingClaim: "" ## Pod resource requests and limits ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ @@ -1154,6 +1155,7 @@ postfix: accessModes: [ReadWriteOnce] claimNameOverride: "" annotations: {} + existingClaim: "" ## Pod resource requests and limits ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ @@ -1362,6 +1364,7 @@ dovecot: accessModes: [ReadWriteOnce] claimNameOverride: "" annotations: {} + existingClaim: "" ## Pod resource requests and limits ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ @@ -1592,6 +1595,7 @@ rspamd: accessModes: [ReadWriteOnce] claimNameOverride: "" annotations: {} + existingClaim: "" ## Pod resource requests and limits ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ @@ -2041,6 +2045,7 @@ webmail: accessModes: [ReadWriteOnce] claimNameOverride: "" annotations: {} + existingClaim: "" ## Pod resource requests and limits ## ref: https://kubernetes.io/docs/user-guide/compute-resources/