mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
helm: automatically enforce RPSS if configured
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
f49a0f0b69
commit
efce94a6ef
2 changed files with 10 additions and 1 deletions
2
.github/workflows/update-helm.yml
vendored
2
.github/workflows/update-helm.yml
vendored
|
|
@ -19,7 +19,7 @@ jobs:
|
||||||
DOCKER_TAG="$(curl -H "Authorization: Bearer ${GHCR_TOKEN}" -L -s 'https://ghcr.io/v2/nextcloud-releases/all-in-one/tags/list?page_size=1024' | jq '.tags' | sed 's|"||g;s|[[:space:]]||g;s|,||g' | grep '^20[0-9_]\+' | grep -v latest | sort -r | head -1)"
|
DOCKER_TAG="$(curl -H "Authorization: Bearer ${GHCR_TOKEN}" -L -s 'https://ghcr.io/v2/nextcloud-releases/all-in-one/tags/list?page_size=1024' | jq '.tags' | sed 's|"||g;s|[[:space:]]||g;s|,||g' | grep '^20[0-9_]\+' | grep -v latest | sort -r | head -1)"
|
||||||
export DOCKER_TAG
|
export DOCKER_TAG
|
||||||
set +x
|
set +x
|
||||||
if [ -n "$DOCKER_TAG" ] && ! grep -q "$DOCKER_TAG" ./nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml; then
|
if [ -n "$DOCKER_TAG" ] && ! grep -q "aio-nextcloud:$DOCKER_TAG" ./nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml; then
|
||||||
sudo bash nextcloud-aio-helm-chart/update-helm.sh "$DOCKER_TAG"
|
sudo bash nextcloud-aio-helm-chart/update-helm.sh "$DOCKER_TAG"
|
||||||
fi
|
fi
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
|
|
|
||||||
|
|
@ -259,6 +259,15 @@ find ./ \( -not -name '*service.yaml' -name '*.yaml' \) -exec sed -i "/^status:/
|
||||||
find ./ \( -not -name '*persistentvolumeclaim.yaml' -name '*.yaml' \) -exec sed -i "/resources:/d" \{} \;
|
find ./ \( -not -name '*persistentvolumeclaim.yaml' -name '*.yaml' \) -exec sed -i "/resources:/d" \{} \;
|
||||||
# shellcheck disable=SC1083
|
# shellcheck disable=SC1083
|
||||||
find ./ -name "*namespace.yaml" -exec sed -i "1i\\{{- if and \(ne .Values.NAMESPACE \"default\"\) \(ne .Values.NAMESPACE_DISABLED \"yes\"\) }}" \{} \;
|
find ./ -name "*namespace.yaml" -exec sed -i "1i\\{{- if and \(ne .Values.NAMESPACE \"default\"\) \(ne .Values.NAMESPACE_DISABLED \"yes\"\) }}" \{} \;
|
||||||
|
# Additional config
|
||||||
|
cat << EOL > /tmp/additional-namespace.config
|
||||||
|
{{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }}
|
||||||
|
labels:
|
||||||
|
pod-security.kubernetes.io/enforce: restricted
|
||||||
|
{{- end }}
|
||||||
|
EOL
|
||||||
|
# shellcheck disable=SC1083
|
||||||
|
find ./ -name "*namespace.yaml" -exec sed -i "/namespace.*/r /tmp/additional-namespace.config" \{} \;
|
||||||
# shellcheck disable=SC1083
|
# shellcheck disable=SC1083
|
||||||
find ./ -name "*namespace.yaml" -exec sed -i "$ a {{- end }}" \{} \;
|
find ./ -name "*namespace.yaml" -exec sed -i "$ a {{- end }}" \{} \;
|
||||||
# shellcheck disable=SC1083
|
# shellcheck disable=SC1083
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue