diff --git a/helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml b/helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml index d91f74ec..b2f48ee1 100755 --- a/helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml +++ b/helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml @@ -28,13 +28,10 @@ spec: - chmod - "777" - /nextcloud-aio-nextcloud - - /nextcloud-aio-nextcloud-data - /nextcloud-aio-nextcloud-trusted-cacerts volumeMounts: - name: nextcloud-aio-nextcloud-trusted-cacerts mountPath: /nextcloud-aio-nextcloud-trusted-cacerts - - name: nextcloud-aio-nextcloud-data - mountPath: /nextcloud-aio-nextcloud-data - name: nextcloud-aio-nextcloud mountPath: /nextcloud-aio-nextcloud containers: diff --git a/helm-chart/update-helm.sh b/helm-chart/update-helm.sh index ff477cef..767fd767 100755 --- a/helm-chart/update-helm.sh +++ b/helm-chart/update-helm.sh @@ -73,8 +73,11 @@ for variable in "${DEPLOYMENTS[@]}"; do volumeNames="$(grep -A1 mountPath "$variable" | grep -v mountPath | sed 's|.*name: ||' | sed '/^--$/d')" mapfile -t volumeNames <<< "$volumeNames" for volumeName in "${volumeNames[@]}"; do - sed -i "/^.*volumeMountsInitContainer:/i\ \ \ \ \ \ \ \ \ \ \ \ - /$volumeName" "$variable" - sed -i "/volumeMountsInitContainer:/a\ \ \ \ \ \ \ \ \ \ \ \ - name: $volumeName\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ mountPath: /$volumeName" "$variable" + # The Nextcloud container runs as root user and sets the correct permissions automatically for the data-dir if the www-data user cannot write to it + if [ "$volumeName" != "nextcloud-aio-nextcloud-data" ]; then + sed -i "/^.*volumeMountsInitContainer:/i\ \ \ \ \ \ \ \ \ \ \ \ - /$volumeName" "$variable" + sed -i "/volumeMountsInitContainer:/a\ \ \ \ \ \ \ \ \ \ \ \ - name: $volumeName\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ mountPath: /$volumeName" "$variable" + fi done sed -i "s|volumeMountsInitContainer|volumeMounts|" "$variable" if grep -q claimName "$variable"; then