Skip to content

Commit

Permalink
Update update-helm.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
szaimen committed Nov 21, 2024
1 parent 8e4d7fa commit 9cbd39a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions nextcloud-aio-helm-chart/update-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,16 @@ for variable in "${DEPLOYMENTS[@]}"; do
fi
done
fi
USER="$(grep runAsUser "$variable" | grep -oP '[0-9]+')"
GROUP="$USER"
if echo "$variable" | grep -q fulltextsearch; then
USER=1000
GROUP=0
fi
sed -i "/runAsUser/d" "$variable"
if [ -n "$USER" ]; then
cat << EOL > /tmp/pod.securityContext
if grep -q runAsUser "$variable"; then
USER="$(grep runAsUser "$variable" | grep -oP '[0-9]+')"
GROUP="$USER"
if echo "$variable" | grep -q fulltextsearch; then
USER=1000
GROUP=0
fi
sed -i "/runAsUser/d" "$variable"
if [ -n "$USER" ]; then
cat << EOL > /tmp/pod.securityContext
securityContext:
# The items below only work in pod context
fsGroup: $USER
Expand All @@ -175,7 +176,8 @@ for variable in "${DEPLOYMENTS[@]}"; do
type: RuntimeDefault
{{- end }}
EOL
sed -i "/^ spec:$/r /tmp/pod.securityContext" "$variable"
sed -i "/^ spec:$/r /tmp/pod.securityContext" "$variable"
fi
fi
fi
done
Expand Down

0 comments on commit 9cbd39a

Please sign in to comment.