From bf34f25d4273dbbba9ad1dd3fa8377fab1df07e2 Mon Sep 17 00:00:00 2001
From: Dennis Sieben <dsieben@owncloud.com>
Date: Mon, 24 Oct 2022 18:55:42 +0200
Subject: [PATCH] - added automatic deployment rolling

---
 charts/owncloud/templates/deployment.yaml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/charts/owncloud/templates/deployment.yaml b/charts/owncloud/templates/deployment.yaml
index 1fa9c48..b7d4354 100644
--- a/charts/owncloud/templates/deployment.yaml
+++ b/charts/owncloud/templates/deployment.yaml
@@ -17,8 +17,9 @@ spec:
       {{- include "owncloud.selectorLabels" . | nindent 6 }}
   template:
     metadata:
-    {{- with .Values.podAnnotations }}
       annotations:
+        checksum/config: {{ print .Values.owncloud.configExtra | sha256sum }}
+    {{- with .Values.podAnnotations }}
         {{- toYaml . | nindent 8 }}
     {{- end }}
       labels:
@@ -34,7 +35,7 @@ spec:
       initContainers:
         - name: "init-{{ .Chart.Name }}"
           image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
-          command: ['sh', '-c', "mkdir -p {{ .Values.owncloud.volume.apps }} {{ .Values.owncloud.volume.config }} {{ .Values.owncloud.volume.config }}/configMap {{ .Values.owncloud.volume.files }} {{ .Values.owncloud.volume.sessions }}; chown -R www-data:www-data {{ .Values.owncloud.volume.root }}; ln -sf {{ .Values.owncloud.volume.config }}/configMap/configmap.config.php {{ .Values.owncloud.volume.config }}/configmap.config.php"]
+          command: ['sh', '-c', "mkdir -p {{ .Values.owncloud.volume.apps }} {{ .Values.owncloud.volume.config }} {{ .Values.owncloud.volume.files }} {{ .Values.owncloud.volume.sessions }}; chown -R www-data:www-data {{ .Values.owncloud.volume.root }}"]
           volumeMounts:
             - name: owncloud-data
               mountPath: {{ .Values.owncloud.volume.root }}
@@ -436,7 +437,8 @@ spec:
             - name: owncloud-data
               mountPath: {{ .Values.owncloud.volume.root }}
             - name: config-volume
-              mountPath: {{ .Values.owncloud.volume.config }}/configMap
+              mountPath: {{ .Values.owncloud.volume.config }}/configmap.config.php
+              subPath: configmap.config.php
       {{- with .Values.nodeSelector }}
       nodeSelector:
         {{- toYaml . | nindent 8 }}