mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-02-23 21:36:19 +08:00
fix database helm permissions
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
26188f797d
commit
484bc235e6
1 changed files with 13 additions and 1 deletions
|
@ -49,12 +49,24 @@ cat << EOL > /tmp/initcontainers
|
||||||
- "777"
|
- "777"
|
||||||
volumeMountsInitContainer:
|
volumeMountsInitContainer:
|
||||||
EOL
|
EOL
|
||||||
|
cat << EOL > /tmp/initcontainers.database
|
||||||
|
- name: init-volumes
|
||||||
|
image: alpine
|
||||||
|
command:
|
||||||
|
- chown
|
||||||
|
- 999:999
|
||||||
|
volumeMountsInitContainer:
|
||||||
|
EOL
|
||||||
# shellcheck disable=SC1083
|
# shellcheck disable=SC1083
|
||||||
DEPLOYMENTS="$(find ./ -name '*deployment.yaml')"
|
DEPLOYMENTS="$(find ./ -name '*deployment.yaml')"
|
||||||
mapfile -t DEPLOYMENTS <<< "$DEPLOYMENTS"
|
mapfile -t DEPLOYMENTS <<< "$DEPLOYMENTS"
|
||||||
for variable in "${DEPLOYMENTS[@]}"; do
|
for variable in "${DEPLOYMENTS[@]}"; do
|
||||||
if grep -q volumeMounts "$variable"; then
|
if grep -q volumeMounts "$variable"; then
|
||||||
sed -i "/^ spec:/r /tmp/initcontainers" "$variable"
|
if ! echo "$variable" | grep -q database; then
|
||||||
|
sed -i "/^ spec:/r /tmp/initcontainers" "$variable"
|
||||||
|
else
|
||||||
|
sed -i "/^ spec:/r /tmp/initcontainers.database" "$variable"
|
||||||
|
fi
|
||||||
volumeNames="$(grep -A1 mountPath "$variable" | grep -v mountPath | sed 's|.*name: ||' | sed '/^--$/d')"
|
volumeNames="$(grep -A1 mountPath "$variable" | grep -v mountPath | sed 's|.*name: ||' | sed '/^--$/d')"
|
||||||
mapfile -t volumeNames <<< "$volumeNames"
|
mapfile -t volumeNames <<< "$volumeNames"
|
||||||
for volumeName in "${volumeNames[@]}"; do
|
for volumeName in "${volumeNames[@]}"; do
|
||||||
|
|
Loading…
Reference in a new issue