Skip to content

Commit

Permalink
fix(RHIDP-2675): fix backend secret for ver 1.1
Browse files Browse the repository at this point in the history
Patch adds backward compatibility to use RHDH 1.1 helm repo,
by setting backend secret name in the helm charts as a variable.
Tested with below config:
For RHDH 1.1
RHDH_HELM_REPO="https://raw.githubusercontent.com/rhdh-bot/openshift-helm-charts/developer-hub-1.1.0/installation/"
RHDH_HELM_CHART="developer-hub"

For RHDH 1.2
RHDH_HELM_REPO=https://raw.githubusercontent.com/rhdh-bot/openshift-helm-charts/redhat-developer-hub-1.2-103-CI/installation/
RHDH_HELM_CHART=redhat-developer-hub
  • Loading branch information
yogananth-subramanian committed Jun 19, 2024
1 parent 61396c2 commit fbe59d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions ci-scripts/rhdh-setup/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fbe59d8

Please sign in to comment.