Skip to content

Commit 02510b0

Browse files
gustavoliraclaude
andcommitted
fix(ci): wait for the image-registry default route before the operator install
Same RHDHBUGS-3758 hardening as on release-1.9: the install script patches the registry and reads default-route before OpenShift creates it, intermittently failing the install. Expose and wait up front; warn-only on timeout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 891b43e commit 02510b0

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎.ci/pipelines/install-methods/operator.sh‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ source "$DIR"/lib/log.sh
1010
# shellcheck source=.ci/pipelines/utils.sh
1111
source "$DIR"/utils.sh
1212

13+
# The install script patches the cluster image registry to expose it and
14+
# immediately reads the default-route, which OpenShift takes a few seconds to
15+
# create — a known race (RHDHBUGS-3758). Expose the registry up front and wait
16+
# for the route so the script's own read finds it. Warn-only on timeout: the
17+
# install retry still gets its chance.
18+
ensure_registry_default_route() {
19+
if [[ "${IS_OPENSHIFT}" != "true" ]]; then
20+
return 0
21+
fi
22+
if ! oc patch configs.imageregistry.operator.openshift.io/cluster --type=merge -p '{"spec":{"defaultRoute":true}}'; then
23+
log::warn "Could not patch the image registry to expose the default route"
24+
return 0
25+
fi
26+
if ! common::poll_until \
27+
"oc get route default-route -n openshift-image-registry &> /dev/null" \
28+
24 5 "Image registry default-route is ready"; then
29+
log::warn "Image registry default-route did not appear within 120s; continuing"
30+
fi
31+
}
32+
1333
install_rhdh_operator() {
1434
local namespace=$1
1535
local max_attempts=$2
@@ -33,6 +53,8 @@ install_rhdh_operator() {
3353
fi
3454
chmod +x /tmp/install-rhdh-catalog-source.sh
3555

56+
ensure_registry_default_route
57+
3658
if [[ "$RELEASE_VERSION" == "next" ]]; then
3759
log::info "Installing RHDH operator with '--next' flag"
3860
# --olm-version v0: keep the CSV-based install path. On clusters that ship

0 commit comments

Comments
 (0)