From f0bf35e57c7db2ba5c4ddfd154552d84d69cd6e4 Mon Sep 17 00:00:00 2001 From: Simon L Date: Mon, 4 Mar 2024 10:24:22 +0100 Subject: [PATCH 1/2] helm - only add namespace if it is not default Signed-off-by: Simon L --- nextcloud-aio-helm-chart/update-helm.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nextcloud-aio-helm-chart/update-helm.sh b/nextcloud-aio-helm-chart/update-helm.sh index 1f8858ef0d3..8fc4ce577b2 100755 --- a/nextcloud-aio-helm-chart/update-helm.sh +++ b/nextcloud-aio-helm-chart/update-helm.sh @@ -218,6 +218,10 @@ find ./ \( -not -name '*service.yaml' -name '*.yaml' \) -exec sed -i "/^status:/ # shellcheck disable=SC1083 find ./ \( -not -name '*persistentvolumeclaim.yaml' -name '*.yaml' \) -exec sed -i "/resources:/d" \{} \; # shellcheck disable=SC1083 +find ./ -name "*namespace.yaml" -exec sed -i "1i\\{{- if ne .Values.NAMESPACE default }}" \{} \; +# shellcheck disable=SC1083 +find ./ -name "*namespace.yaml" -exec sed -i "$ a {{- end }}" \{} \; +# shellcheck disable=SC1083 find ./ -name '*.yaml' -exec sed -i "/creationTimestamp: null/d" \{} \; VOLUMES="$(find ./ -name '*persistentvolumeclaim.yaml' | sed 's|-persistentvolumeclaim.yaml||g;s|.*nextcloud-aio-||g' | sort)" mapfile -t VOLUMES <<< "$VOLUMES" From b866fe25db355c31103b84b46be397b0b0419435 Mon Sep 17 00:00:00 2001 From: Simon L Date: Mon, 4 Mar 2024 11:16:23 +0100 Subject: [PATCH 2/2] address review Signed-off-by: Simon L Co-authored-by: Richard Steinmetz Signed-off-by: Simon L. --- nextcloud-aio-helm-chart/update-helm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextcloud-aio-helm-chart/update-helm.sh b/nextcloud-aio-helm-chart/update-helm.sh index 8fc4ce577b2..2cd0b38edec 100755 --- a/nextcloud-aio-helm-chart/update-helm.sh +++ b/nextcloud-aio-helm-chart/update-helm.sh @@ -218,7 +218,7 @@ find ./ \( -not -name '*service.yaml' -name '*.yaml' \) -exec sed -i "/^status:/ # shellcheck disable=SC1083 find ./ \( -not -name '*persistentvolumeclaim.yaml' -name '*.yaml' \) -exec sed -i "/resources:/d" \{} \; # shellcheck disable=SC1083 -find ./ -name "*namespace.yaml" -exec sed -i "1i\\{{- if ne .Values.NAMESPACE default }}" \{} \; +find ./ -name "*namespace.yaml" -exec sed -i "1i\\{{- if ne .Values.NAMESPACE \"default\" }}" \{} \; # shellcheck disable=SC1083 find ./ -name "*namespace.yaml" -exec sed -i "$ a {{- end }}" \{} \; # shellcheck disable=SC1083