From 6e2b13b0a8148d5236087c697cc4f012fcbed5fd Mon Sep 17 00:00:00 2001 From: Fede Alonso Date: Mon, 13 Jul 2026 16:22:50 +0200 Subject: [PATCH 1/4] Fix backward compatibility for MaaS DB config namespace detection Detect INFRA_NAMESPACE from the deployed maas-controller instead of unconditionally deriving the infra namespace. Operators without INFRA_NAMESPACE support (pre-3.5, EA2 before July 13 rebuild) place maas-db-config in the applications namespace; new operators with INFRA_NAMESPACE=AUTO use the separate infra namespace. --- .../Database/configure_maas_postgres.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh b/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh index 46a84b623..1d9744c4b 100755 --- a/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh +++ b/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh @@ -29,7 +29,23 @@ derive_infra_namespace() { esac } -INFRA_NS=$(derive_infra_namespace "${APPS_NS}") +detect_infra_namespace() { + local apps_ns="$1" + local infra_val + infra_val=$(oc get deployment maas-controller -n "${apps_ns}" \ + -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="INFRA_NAMESPACE")].value}' \ + 2>/dev/null) + + if [[ "${infra_val}" == "AUTO" ]]; then + derive_infra_namespace "${apps_ns}" + elif [[ -n "${infra_val}" ]]; then + echo "${infra_val}" + else + echo "${apps_ns}" + fi +} + +INFRA_NS=$(detect_infra_namespace "${APPS_NS}") # Ensure namespaces exist oc create namespace "${APPS_NS}" --dry-run=client -o yaml | oc apply -f - From 11cb3ad292e194ce151eefcb56a095e907a65d83 Mon Sep 17 00:00:00 2001 From: Fede Alonso Date: Mon, 13 Jul 2026 21:13:03 +0200 Subject: [PATCH 2/4] wait properly to maas controller --- .../Resources/Database/configure_maas_postgres.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh b/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh index 1d9744c4b..00a3ede2d 100755 --- a/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh +++ b/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh @@ -31,6 +31,18 @@ derive_infra_namespace() { detect_infra_namespace() { local apps_ns="$1" + + # MaaS provisioning may run before the RHOAI operator has deployed the + # maas-controller. Without waiting, detect would see no controller and + # always fall back to the apps namespace — then when the operator deploys + # a controller with INFRA_NAMESPACE=AUTO it looks in the infra namespace + # where the secret doesn't exist, and maas-api never starts. + echo "Waiting for maas-controller deployment in ${apps_ns}..." + for i in $(seq 1 30); do + oc get deployment maas-controller -n "${apps_ns}" &>/dev/null && break + sleep 10 + done + local infra_val infra_val=$(oc get deployment maas-controller -n "${apps_ns}" \ -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="INFRA_NAMESPACE")].value}' \ From e99c5af4a1a348606cc9ea9b5ae94d3554174b68 Mon Sep 17 00:00:00 2001 From: Fede Alonso Date: Tue, 14 Jul 2026 07:38:19 +0200 Subject: [PATCH 3/4] wait properly to maas controller --- ods_ci/tasks/Resources/Database/configure_maas_postgres.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh b/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh index 00a3ede2d..3c75911cd 100755 --- a/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh +++ b/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh @@ -37,7 +37,7 @@ detect_infra_namespace() { # always fall back to the apps namespace — then when the operator deploys # a controller with INFRA_NAMESPACE=AUTO it looks in the infra namespace # where the secret doesn't exist, and maas-api never starts. - echo "Waiting for maas-controller deployment in ${apps_ns}..." + echo "Waiting for maas-controller deployment in ${apps_ns}..." >&2 for i in $(seq 1 30); do oc get deployment maas-controller -n "${apps_ns}" &>/dev/null && break sleep 10 From 3c6acb585484bb630d20af4a7b2d4d1531de068b Mon Sep 17 00:00:00 2001 From: Fede Alonso Date: Tue, 14 Jul 2026 11:09:12 +0200 Subject: [PATCH 4/4] Increase tiemout --- .../Resources/Database/configure_maas_postgres.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh b/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh index 3c75911cd..73b5df77c 100755 --- a/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh +++ b/ods_ci/tasks/Resources/Database/configure_maas_postgres.sh @@ -32,13 +32,15 @@ derive_infra_namespace() { detect_infra_namespace() { local apps_ns="$1" - # MaaS provisioning may run before the RHOAI operator has deployed the - # maas-controller. Without waiting, detect would see no controller and - # always fall back to the apps namespace — then when the operator deploys - # a controller with INFRA_NAMESPACE=AUTO it looks in the infra namespace - # where the secret doesn't exist, and maas-api never starts. + # MaaS provisioning may run before the RHOAI operator has fully deployed + # the maas-controller (CRD registration, reconciliation, and pod scheduling + # can take 10+ minutes after the CSV is ready). Without waiting, detect + # would see no controller and fall back to the apps namespace — then when + # the operator deploys a controller with INFRA_NAMESPACE=AUTO it looks in + # the infra namespace where the secret doesn't exist, and maas-api never + # starts. Wait up to 15 minutes to cover slow clusters. echo "Waiting for maas-controller deployment in ${apps_ns}..." >&2 - for i in $(seq 1 30); do + for i in $(seq 1 90); do oc get deployment maas-controller -n "${apps_ns}" &>/dev/null && break sleep 10 done