Преглед на файлове

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

Stavros kois преди 1 година
родител
ревизия
07920d9224
променени са 2 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 5 0
      library/common/templates/app_functions/_mariadb.tpl
  2. 5 0
      library/common/templates/app_functions/_postgres.tpl

+ 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 */}}