mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-01-28 08:29:20 +08:00
Merge pull request #3792 from nextcloud/enh/noid/remove-lost+found
This commit is contained in:
commit
4a9c344473
4 changed files with 37 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
name: nextcloud-aio-helm-chart
|
||||
description: A generated Helm Chart for Nextcloud AIO from Skippbox Kompose
|
||||
version: 7.7.1-dev3
|
||||
version: 7.7.1-dev4
|
||||
apiVersion: v2
|
||||
keywords:
|
||||
- latest
|
||||
|
|
|
@ -42,4 +42,8 @@ spec:
|
|||
ports:
|
||||
- containerPort: 9980
|
||||
protocol: TCP
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- MKNOD
|
||||
{{- end }}
|
||||
|
|
|
@ -23,6 +23,17 @@ spec:
|
|||
io.kompose.service: nextcloud-aio-nextcloud
|
||||
spec:
|
||||
initContainers:
|
||||
- name: delete lost+found
|
||||
image: alpine
|
||||
command:
|
||||
- rm
|
||||
- "-rf"
|
||||
- /nextcloud-aio-nextcloud/lost+found
|
||||
volumeMounts:
|
||||
- name: nextcloud-aio-nextcloud-trusted-cacerts
|
||||
mountPath: /nextcloud-aio-nextcloud-trusted-cacerts
|
||||
- name: nextcloud-aio-nextcloud
|
||||
mountPath: /nextcloud-aio-nextcloud
|
||||
- name: init-volumes
|
||||
image: alpine
|
||||
command:
|
||||
|
|
|
@ -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…
Reference in a new issue