From 368a9b7f462acd23682b1d180a343a5459c36e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Mac=C3=ADk?= Date: Fri, 22 Nov 2024 11:57:44 +0100 Subject: [PATCH] fix(RHIDP-4928): fix dynamic-plugins for RHDH v1.4 (#126) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(RHIDP-4928): fix dynamic-plugins for RHDH v1.4 Signed-off-by: Pavel Macík * apply workaround for RHIDP-4936 and RHIDP-4937 Signed-off-by: Pavel Macík --------- Signed-off-by: Pavel Macík --- ci-scripts/rhdh-setup/deploy.sh | 22 +++++++++++++- .../template/backstage/app-config.yaml | 10 +++++++ .../helm/chart-values.image-override.yaml | 15 ++++++---- .../template/backstage/helm/chart-values.yaml | 7 ++++- .../backstage/helm/extravolume-patch-1.4.yaml | 29 ++++++++----------- .../helm/oauth2-container-patch.yaml | 2 +- .../backstage/helm/rbac-plugin-patch.yaml | 2 +- .../template/backstage/olm/backstage.yaml | 12 +++----- .../olm/dynamic-plugins.configmap.yaml | 2 +- .../backstage/olm/rbac-plugin-patch.yaml | 2 +- .../backstage/olm/rhdh-oauth2.deployment.yaml | 2 +- .../template/backstage/techdocs-pvc.yaml | 10 +++++++ 12 files changed, 78 insertions(+), 37 deletions(-) create mode 100644 ci-scripts/rhdh-setup/template/backstage/techdocs-pvc.yaml diff --git a/ci-scripts/rhdh-setup/deploy.sh b/ci-scripts/rhdh-setup/deploy.sh index caf1b2a..a737cff 100755 --- a/ci-scripts/rhdh-setup/deploy.sh +++ b/ci-scripts/rhdh-setup/deploy.sh @@ -210,6 +210,24 @@ create_objs() { fi } +# TODO: remove once https://issues.redhat.com/browse/RHIDP-4936 and https://issues.redhat.com/browse/RHIDP-4937 are fixed +RHIDP-4936_RHIDP-4937_workaround() { + log_info "Applyling workaround for https://issues.redhat.com/browse/RHIDP-4936 and https://issues.redhat.com/browse/RHIDP-4937 issues" + pod=$($clin get pods -l app.kubernetes.io/instance=rhdh -o json | jq -rc '.items[] | select(.metadata.name | startswith("rhdh-developer-hub")).metadata.name') + for package in backstage-community-plugin-catalog-backend-module-keycloak-dynamic backstage-plugin-techdocs-backend-dynamic; do + log_info "Applying workaround for $package package" + $clin exec "$pod" -c backstage-backend -- bash -c "for i in \$(find /opt/app-root/src/dynamic-plugins-root -type d -name '$package*'); do cd \$i; npm install; done" + done + log_info "Restarting RHDH..." + if [ "$INSTALL_METHOD" == "helm" ]; then + rhdh_deployment="${RHDH_HELM_RELEASE_NAME}-developer-hub" + elif [ "$INSTALL_METHOD" == "olm" ]; then + rhdh_deployment=backstage-developer-hub + fi + $clin rollout restart deployment/"$rhdh_deployment" + wait_to_start deployment "$rhdh_deployment" 300 300 +} + backstage_install() { log_info "Installing RHDH with install method: $INSTALL_METHOD" cp "template/backstage/app-config.yaml" "$TMP_DIR/app-config.yaml" @@ -242,6 +260,7 @@ backstage_install() { until $clin create -f "$TMP_DIR/rbac-config.yaml"; do $clin delete configmap rbac-policy --ignore-not-found=true; done fi envsubst