diff --git a/ci-scripts/rhdh-setup/deploy.sh b/ci-scripts/rhdh-setup/deploy.sh index 8c06b02..9820b96 100755 --- a/ci-scripts/rhdh-setup/deploy.sh +++ b/ci-scripts/rhdh-setup/deploy.sh @@ -186,6 +186,13 @@ install_rhdh_with_helm() { chart_origin="$chart_origin@$RHDH_HELM_CHART_VERSION" fi echo "Installing RHDH Helm chart $RHDH_HELM_RELEASE_NAME from $chart_origin in $RHDH_NAMESPACE namespace" + helm_ver='helm search repo --devel --version 1.1 --fail-on-no-result' + $helm_ver + if [ $? -eq 0 ]; then + export RHDH_HELM_SECRET_BACKEND='developer-hub-auth' + else + export RHDH_HELM_SECRET_BACKEND='auth' + fi cp "$chart_values" "$TMP_DIR/chart-values.temp.yaml" if [ "${AUTH_PROVIDER}" == "keycloak" ]; then yq -i '.upstream.backstage |= . + load("template/backstage/helm/oauth2-container-patch.yaml")' "$TMP_DIR/chart-values.temp.yaml"; fi envsubst \ @@ -199,6 +206,7 @@ install_rhdh_with_helm() { ${RHDH_IMAGE_REPO} \ ${RHDH_IMAGE_TAG} \ ${RHDH_NAMESPACE} \ + ${RHDH_HELM_SECRET_BACKEND} \ ${COOKIE_SECRET} \ ' <"$TMP_DIR/chart-values.temp.yaml" >"$TMP_DIR/chart-values.yaml" if [ -n "${RHDH_RESOURCES_CPU_REQUESTS}" ]; then yq -i '.upstream.backstage.resources.requests.cpu = "'"${RHDH_RESOURCES_CPU_REQUESTS}"'"' "$TMP_DIR/chart-values.yaml"; fi diff --git a/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.image-override.yaml b/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.image-override.yaml index 0d93bc5..fa05c2a 100644 --- a/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.image-override.yaml +++ b/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.image-override.yaml @@ -61,7 +61,7 @@ upstream: valueFrom: secretKeyRef: key: backend-secret - name: "{{ .Release.Name }}-auth" + name: "{{ .Release.Name }}-${RHDH_HELM_SECRET_BACKEND}" - name: GITHUB_TOKEN valueFrom: secretKeyRef: diff --git a/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.yaml b/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.yaml index b4de2be..4159c3c 100644 --- a/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.yaml +++ b/ci-scripts/rhdh-setup/template/backstage/helm/chart-values.yaml @@ -61,7 +61,7 @@ upstream: valueFrom: secretKeyRef: key: backend-secret - name: "{{ .Release.Name }}-auth" + name: "{{ .Release.Name }}-${RHDH_HELM_SECRET_BACKEND}" - name: GITHUB_TOKEN valueFrom: secretKeyRef: