mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
helm - fix lost+found in nextcloud
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
f0fd5b692d
commit
b85ffbb0cc
4 changed files with 37 additions and 2 deletions
|
|
@ -98,6 +98,22 @@ cat << EOL > /tmp/initcontainers.clamav
|
|||
- "-R"
|
||||
volumeMountsInitContainer:
|
||||
EOL
|
||||
cat << EOL > /tmp/initcontainers.nextcloud
|
||||
initContainers:
|
||||
- name: delete lost+found
|
||||
image: alpine
|
||||
command:
|
||||
- rm
|
||||
- "-rf"
|
||||
- /nextcloud-aio-nextcloud/lost+found
|
||||
volumeMountsInitRmLostFound:
|
||||
- name: init-volumes
|
||||
image: alpine
|
||||
command:
|
||||
- chmod
|
||||
- "777"
|
||||
volumeMountsInitContainer:
|
||||
EOL
|
||||
# shellcheck disable=SC1083
|
||||
DEPLOYMENTS="$(find ./ -name '*deployment.yaml')"
|
||||
mapfile -t DEPLOYMENTS <<< "$DEPLOYMENTS"
|
||||
|
|
@ -107,6 +123,8 @@ for variable in "${DEPLOYMENTS[@]}"; do
|
|||
sed -i "/^ spec:/r /tmp/initcontainers.database" "$variable"
|
||||
elif echo "$variable" | grep -q clamav; then
|
||||
sed -i "/^ spec:/r /tmp/initcontainers.clamav" "$variable"
|
||||
elif echo "$variable" | grep -q "nextcloud-deployment.yaml"; then
|
||||
sed -i "/^ spec:/r /tmp/initcontainers.nextcloud" "$variable"
|
||||
else
|
||||
sed -i "/^ spec:/r /tmp/initcontainers" "$variable"
|
||||
fi
|
||||
|
|
@ -117,6 +135,7 @@ for variable in "${DEPLOYMENTS[@]}"; do
|
|||
if [ "$volumeName" != "nextcloud-aio-nextcloud-data" ]; then
|
||||
sed -i "/^.*volumeMountsInitContainer:/i\ \ \ \ \ \ \ \ \ \ \ \ - /$volumeName" "$variable"
|
||||
sed -i "/volumeMountsInitContainer:/a\ \ \ \ \ \ \ \ \ \ \ \ - name: $volumeName\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ mountPath: /$volumeName" "$variable"
|
||||
sed -i "/volumeMountsInitRmLostFound:/a\ \ \ \ \ \ \ \ \ \ \ \ - name: $volumeName\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ mountPath: /$volumeName" "$variable"
|
||||
# Workaround for the database volume
|
||||
if [ "$volumeName" = nextcloud-aio-database ]; then
|
||||
sed -i "/mountPath: \/var\/lib\/postgresql\/data/a\ \ \ \ \ \ \ \ \ \ \ \ \ \ subPath: data" "$variable"
|
||||
|
|
@ -126,7 +145,8 @@ for variable in "${DEPLOYMENTS[@]}"; do
|
|||
|
||||
fi
|
||||
done
|
||||
sed -i "s|volumeMountsInitContainer|volumeMounts|" "$variable"
|
||||
sed -i "s|volumeMountsInitContainer:|volumeMounts:|" "$variable"
|
||||
sed -i "s|volumeMountsInitRmLostFound:|volumeMounts:|" "$variable"
|
||||
if grep -q claimName "$variable"; then
|
||||
claimNames="$(grep claimName "$variable")"
|
||||
mapfile -t claimNames <<< "$claimNames"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue