From 819899d0256f680c514dedfc80a9a907078cbb83 Mon Sep 17 00:00:00 2001 From: desmax74 Date: Tue, 19 May 2026 15:57:21 +0200 Subject: [PATCH 1/2] Storage create before migratedb and server start Signed-off-by: desmax74 --- .../010-PersistentVolumeClaim-storage.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename charts/trustify/templates/{services/server => common}/010-PersistentVolumeClaim-storage.yaml (81%) diff --git a/charts/trustify/templates/services/server/010-PersistentVolumeClaim-storage.yaml b/charts/trustify/templates/common/010-PersistentVolumeClaim-storage.yaml similarity index 81% rename from charts/trustify/templates/services/server/010-PersistentVolumeClaim-storage.yaml rename to charts/trustify/templates/common/010-PersistentVolumeClaim-storage.yaml index e4f29eb..9dfa8ed 100644 --- a/charts/trustify/templates/services/server/010-PersistentVolumeClaim-storage.yaml +++ b/charts/trustify/templates/common/010-PersistentVolumeClaim-storage.yaml @@ -1,4 +1,3 @@ -{{- if .Values.modules.server.enabled }} {{- $res := dict "root" . "name" "storage" -}} {{- if eq .Values.storage.type "filesystem" }} @@ -9,6 +8,11 @@ metadata: labels: {{- include "trustification.common.labels" $res | nindent 4 }} + annotations: + helm.sh/hook: "pre-install,pre-upgrade" + helm.sh/hook-weight: "10" + helm.sh/resource-policy: keep + spec: accessModes: - ReadWriteOnce @@ -21,5 +25,3 @@ spec: {{- end }} {{- end }} - -{{- end }} From c0a8f53e22b0baa3ec3a04f6c3bc08898b890fbd Mon Sep 17 00:00:00 2001 From: desmax74 Date: Wed, 20 May 2026 14:58:14 +0200 Subject: [PATCH 2/2] Added check if the PV is already there Signed-off-by: desmax74 --- .../templates/common/010-PersistentVolumeClaim-storage.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/trustify/templates/common/010-PersistentVolumeClaim-storage.yaml b/charts/trustify/templates/common/010-PersistentVolumeClaim-storage.yaml index 9dfa8ed..d166636 100644 --- a/charts/trustify/templates/common/010-PersistentVolumeClaim-storage.yaml +++ b/charts/trustify/templates/common/010-PersistentVolumeClaim-storage.yaml @@ -1,6 +1,9 @@ {{- $res := dict "root" . "name" "storage" -}} {{- if eq .Values.storage.type "filesystem" }} +{{- $pvcName := (include "trustification.common.name" $res) }} +{{- $existingPVC := (lookup "v1" "PersistentVolumeClaim" .Release.Namespace $pvcName) }} +{{- if not $existingPVC }} kind: PersistentVolumeClaim apiVersion: v1 metadata: @@ -25,3 +28,4 @@ spec: {{- end }} {{- end }} +{{- end }}