Skip to content

Commit 3d1787b

Browse files
committed
fix: orchestrator install fixes - startingCSV, OLM status checks
- Replace check_operator_status with OLM label-based wait_for_operator: spec.displayName varies across channels/versions, causing empty CSV matches and operator timeouts. Uses deterministic operators.coreos.com/<package>.<namespace> label selectors instead. - Add startingCSV pinning to logic-operator.v1.37.2: Ensures the subscription installs the exact OSL version instead of whatever stable channel resolves to. - Add prepack lifecycle script: Ensures dist/ is built when the package is installed as a git dependency. Made-with: Cursor
1 parent ed332ff commit 3d1787b

3 files changed

Lines changed: 24 additions & 12 deletions

File tree

docs/changelog.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [1.1.30] - Current
5+
## [1.1.31] - Current
6+
7+
### Fixed
8+
9+
- **Replace `check_operator_status` with OLM label-based `wait_for_operator`**: `spec.displayName` varies across channels/versions, causing empty CSV matches and operator timeouts. Uses deterministic `operators.coreos.com/<package>.<namespace>` label selectors instead.
10+
- **Add `startingCSV` pinning to `logic-operator.v1.37.2`**: Ensures the subscription installs the exact OSL version instead of whatever `stable` channel resolves to.
11+
- **Add `prepack` lifecycle script**: Ensures `dist/` is built when the package is installed as a git dependency (Yarn 3 packs from source, skipping gitignored `dist/`).
12+
13+
## [1.1.30]
614

715
### Fixed
816

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@red-hat-developer-hub/e2e-test-utils",
3-
"version": "1.1.30",
3+
"version": "1.1.31",
44
"description": "Test utilities for RHDH E2E tests",
55
"license": "Apache-2.0",
66
"repository": {

src/deployment/orchestrator/install-orchestrator.sh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,29 @@ EOD
122122
return 0
123123
}
124124

125-
check_operator_status() {
126-
local timeout=${1:-300} namespace=$2 operator_name=$3 expected_status=${4:-Succeeded}
127-
log::info "Checking operator '${operator_name}' in '${namespace}' (timeout ${timeout}s, expected: ${expected_status})"
125+
# Wait for an operator CSV to reach a status phase.
126+
# Uses OLM label selector (operators.coreos.com/<package>.<namespace>) which is
127+
# deterministic, unlike spec.displayName which varies across channels/versions.
128+
wait_for_operator() {
129+
local timeout=${1:-300} namespace=$2 package=$3 expected_status=${4:-Succeeded}
130+
local label="operators.coreos.com/${package}.${namespace}"
131+
log::info "Waiting for operator '${package}' in '${namespace}' (label=${label}, timeout ${timeout}s, expected: ${expected_status})"
128132
timeout "${timeout}" bash -c "
129133
while true; do
130-
CURRENT_PHASE=\$(oc get csv -n '${namespace}' -o jsonpath='{.items[?(@.spec.displayName==\"${operator_name}\")].status.phase}')
131-
echo \"[check_operator_status] Phase: \${CURRENT_PHASE}\" >&2
132-
[[ \"\${CURRENT_PHASE}\" == \"${expected_status}\" ]] && echo \"[check_operator_status] Operator reached ${expected_status}\" >&2 && break
134+
CURRENT_PHASE=\$(oc get csv -n '${namespace}' -l '${label}' -o jsonpath='{.items[0].status.phase}' 2>/dev/null)
135+
echo \"[wait_for_operator] Phase: \${CURRENT_PHASE}\" >&2
136+
[[ \"\${CURRENT_PHASE}\" == \"${expected_status}\" ]] && echo \"[wait_for_operator] Operator reached ${expected_status}\" >&2 && break
133137
sleep 10
134138
done
135-
" || { log::error "Operator did not reach ${expected_status} in time."; return 1; }
139+
" || { log::error "Operator '${package}' did not reach ${expected_status} in time."; return 1; }
136140
}
137141

138142
install_serverless_logic_ocp_operator() {
139-
install_subscription logic-operator openshift-operators stable logic-operator redhat-operators openshift-marketplace
143+
install_subscription logic-operator openshift-operators stable logic-operator redhat-operators openshift-marketplace logic-operator.v1.37.2
140144
return 0
141145
}
142146
waitfor_serverless_logic_ocp_operator() {
143-
check_operator_status 500 openshift-operators "Red Hat OpenShift Serverless Logic" Succeeded
147+
wait_for_operator 500 openshift-operators logic-operator Succeeded
144148
return 0
145149
}
146150

@@ -149,7 +153,7 @@ install_serverless_ocp_operator() {
149153
return 0
150154
}
151155
waitfor_serverless_ocp_operator() {
152-
check_operator_status 300 openshift-operators "Red Hat OpenShift Serverless" Succeeded
156+
wait_for_operator 300 openshift-operators serverless-operator Succeeded
153157
return 0
154158
}
155159

0 commit comments

Comments
 (0)