Sfoglia il codice sorgente

Show a message when user tries to upgrade app with db from a stopped state

Stavros kois 1 anno fa
parent
commit
07920d9224

+ 5 - 0
library/common/templates/app_functions/_mariadb.tpl

@@ -70,6 +70,11 @@ backupChownMode (optional): Whether to chown the backup directory or
   {{- if $ixChartContext.isUpgrade -}}
     {{- $enableBackupJob = true -}}
   {{- end -}}
+  {{- if hasKey $ixChartContext "isStopped" -}}
+    {{- if $ixChartContext.isStopped -}}
+      {{- fail "Application must be running before upgrade. This is to ensure the database backup will be able to complete." -}}
+    {{- end -}}
+  {{- end -}}
 {{- else -}}
   {{/*
     If the key is not present in ixChartContext,

+ 5 - 0
library/common/templates/app_functions/_postgres.tpl

@@ -75,6 +75,11 @@ backupChownMode (optional): Whether to chown the backup directory or
     {{- if $ixChartContext.isUpgrade -}}
       {{- $enableBackupJob = true -}}
     {{- end -}}
+    {{- if hasKey $ixChartContext "isStopped" -}}
+      {{- if $ixChartContext.isStopped -}}
+        {{- fail "Application must be running before upgrade. This is to ensure the database backup will be able to complete." -}}
+      {{- end -}}
+    {{- end -}}
   {{- else -}}
     {{/* If the key is not present in ixChartContext, means we
       are outside SCALE (Probably CI), let upgrade job run */}}