From e8e103b56ed46d674dff173eca0a0d1713dfed54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=B6ran=20P=C3=B6hner?=
 <10630407+groundhog2k@users.noreply.github.com>
Date: Tue, 28 Mar 2023 08:16:55 +0200
Subject: [PATCH] Fix default update strategy when using Deployment instead of
 StatefulSet (#1221)

---
 charts/mariadb/Chart.yaml                 | 2 +-
 charts/mariadb/README.md                  | 2 +-
 charts/mariadb/RELEASENOTES.md            | 1 +
 charts/mariadb/templates/statefulset.yaml | 3 +++
 charts/redis/Chart.yaml                   | 2 +-
 charts/redis/README.md                    | 2 +-
 charts/redis/RELEASENOTES.md              | 1 +
 charts/redis/templates/statefulset.yaml   | 5 ++++-
 8 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/charts/mariadb/Chart.yaml b/charts/mariadb/Chart.yaml
index ffe007b4..83c8905f 100644
--- a/charts/mariadb/Chart.yaml
+++ b/charts/mariadb/Chart.yaml
@@ -7,6 +7,6 @@ type: application
 maintainers:
   - name: groundhog2k
 
-version: "0.8.1"
+version: "0.8.2"
 
 appVersion: "10.11.2"
diff --git a/charts/mariadb/README.md b/charts/mariadb/README.md
index be98aec3..074b07b8 100644
--- a/charts/mariadb/README.md
+++ b/charts/mariadb/README.md
@@ -1,6 +1,6 @@
 # MariaDB
 
-![Version: 0.8.1](https://img.shields.io/badge/Version-0.8.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 10.11.2](https://img.shields.io/badge/AppVersion-10.11.2-informational?style=flat-square)
+![Version: 0.8.2](https://img.shields.io/badge/Version-0.8.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 10.11.2](https://img.shields.io/badge/AppVersion-10.11.2-informational?style=flat-square)
 
 ## Changelog
 
diff --git a/charts/mariadb/RELEASENOTES.md b/charts/mariadb/RELEASENOTES.md
index b1f9ed4f..1f940a5a 100644
--- a/charts/mariadb/RELEASENOTES.md
+++ b/charts/mariadb/RELEASENOTES.md
@@ -48,4 +48,5 @@
 | 0.7.2 | 10.10.3 | Upgraded MariaDB to 10.10.3 |
 | 0.8.0 | 10.11.2 | Upgraded MariaDB to 10.11.2 |
 | 0.8.1 | 10.11.2 | Implemented alternative distribution with `Deployment` template (thx @tim-hanssen) |
+| 0.8.2 | 10.11.2 | Fix default update strategy to `Recreate` for distribution with `Deployment` |
 | | | |
diff --git a/charts/mariadb/templates/statefulset.yaml b/charts/mariadb/templates/statefulset.yaml
index 33e9762e..6330b007 100644
--- a/charts/mariadb/templates/statefulset.yaml
+++ b/charts/mariadb/templates/statefulset.yaml
@@ -20,6 +20,9 @@ spec:
   podManagementPolicy: {{ .Values.podManagementPolicy }}
   updateStrategy: 
     type: {{ .Values.updateStrategyType }}
+  {{- else }}
+  strategy:
+    type: Recreate
   {{- end }}
   selector:
     matchLabels:
diff --git a/charts/redis/Chart.yaml b/charts/redis/Chart.yaml
index e8871d3c..39433304 100644
--- a/charts/redis/Chart.yaml
+++ b/charts/redis/Chart.yaml
@@ -8,7 +8,7 @@ maintainers:
   - name: groundhog2k
 
 # This is the chart version
-version: "0.6.6"
+version: "0.6.7"
 
 # This is the version number of the application being deployed.
 appVersion: "7.0.10"
diff --git a/charts/redis/README.md b/charts/redis/README.md
index 1c1cabfc..4076fa12 100644
--- a/charts/redis/README.md
+++ b/charts/redis/README.md
@@ -1,6 +1,6 @@
 # Redis
 
-![Version: 0.6.6](https://img.shields.io/badge/Version-0.6.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 7.0.10](https://img.shields.io/badge/AppVersion-7.0.10-informational?style=flat-square)
+![Version: 0.6.7](https://img.shields.io/badge/Version-0.6.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 7.0.10](https://img.shields.io/badge/AppVersion-7.0.10-informational?style=flat-square)
 
 ## Changelog
 
diff --git a/charts/redis/RELEASENOTES.md b/charts/redis/RELEASENOTES.md
index fabbff79..d10e95a9 100644
--- a/charts/redis/RELEASENOTES.md
+++ b/charts/redis/RELEASENOTES.md
@@ -26,4 +26,5 @@
 | 0.6.4 | 7.0.9 | Added option to use Deployment instead of StatefulSet for Non-HA deployments - thx @tim-hanssen |
 | 0.6.5 | 7.0.10 | Upgraded to Redis 7.0.10 |
 | 0.6.6 | 7.0.10 | Fixed redis volume deployment in non-HA mode |
+| 0.6.7 | 7.0.10 | Fix default update strategy to `Recreate` for distribution with `Deployment` |
 | | | |
diff --git a/charts/redis/templates/statefulset.yaml b/charts/redis/templates/statefulset.yaml
index 47384849..28bc4b50 100644
--- a/charts/redis/templates/statefulset.yaml
+++ b/charts/redis/templates/statefulset.yaml
@@ -23,8 +23,11 @@ spec:
   {{- if or (.Values.haMode.enabled) (not .Values.useDeploymentWhenNonHA) }}
   serviceName: {{ $fullname }}-headless
   podManagementPolicy: {{ .Values.podManagementPolicy }}
-  updateStrategy: 
+  updateStrategy:
     type: {{ .Values.updateStrategyType }}
+  {{- else }}
+  strategy:
+    type: Recreate
   {{- end }}
   selector:
     matchLabels:
-- 
GitLab