Conversation
`oc get subscription` relies on the short resource name resolving to
subscriptions.operators.coreos.com. On any cluster that also runs Red Hat
Advanced Cluster Management, ACM registers subscriptions.apps.open-cluster-
management.io under the same plural name, and oc resolves the ambiguity to
the ACM group instead:
$ oc get subscription nfd -n openshift-nfd
Error from server (NotFound):
subscriptions.apps.open-cluster-management.io "nfd" not found
Two consequences on such clusters:
1. wait_for_subscription_csv() discards that error via `2>/dev/null || true`,
so current_csv and installed_csv are empty on every poll, csv_name stays
empty, and the CSV phase check never runs. The loop spins for the full
timeout and then fails with a misleading "currentCSV=not-created" even
though the operator installed successfully. This blocks the installer at
step 2 for 600s (NFD) and would again at step 3 for 900s (GPU Operator).
2. main_delete() pairs the same lookup with `--ignore-not-found=true`, so
teardown silently leaves the OLM Subscription and its CSV behind.
Pin all nine call sites to the fully qualified
subscriptions.operators.coreos.com. This is a no-op on clusters without ACM,
where the short name already resolves to the OLM group.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b78cd500f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| current_csv=$(oc get subscriptions.operators.coreos.com "${subscription}" -n "${namespace}" \ | ||
| -o jsonpath='{.status.currentCSV}' 2>/dev/null || true) | ||
| installed_csv=$(oc get subscription "${subscription}" -n "${namespace}" \ | ||
| installed_csv=$(oc get subscriptions.operators.coreos.com "${subscription}" -n "${namespace}" \ |
There was a problem hiding this comment.
Update the OLM readiness mock for the qualified resource
When tools/cluster_setup/test_openshift_with_stack.sh runs, its oc mock at lines 603–606 only returns CSV names when ${2:-} equals subscription. These qualified lookups therefore return nothing, causing wait_for_subscription_csv to exhaust all three mocked polls; the assertion at lines 616–617 receives 3 instead of 1, and the test suite exits nonzero. Update the mock to recognize subscriptions.operators.coreos.com alongside this production change.
Useful? React with 👍 / 👎.
Problem
tools/cluster_setup/openshift_with_stack.shcallsoc get subscription/oc delete subscriptionusing the short resource name, which assumes it resolves tosubscriptions.operators.coreos.com.On a cluster that also runs Red Hat Advanced Cluster Management, ACM registers a second CRD under the same plural name, and
ocresolves the ambiguity to the ACM group:Impact
1. Install hangs, then fails with a misleading error.
wait_for_subscription_csv()discards theNotFoundvia2>/dev/null || true, socurrent_csvandinstalled_csvcome back empty on every poll.csv_namestays empty, the CSV phase check is never reached, and the loop spins for the full timeout:The operator had in fact installed correctly the whole time:
This blocks step 2 (NFD, 600s) and would block step 3 again (GPU Operator, 900s).
2. Teardown leaves orphans.
main_delete()pairs the same lookup with--ignore-not-found=true, so the OLM Subscription and its CSV are silently left behind on delete.Fix
Pin all nine call sites to the fully qualified
subscriptions.operators.coreos.com. No logic changes.This is a no-op on clusters without ACM, where the short name already resolves to the OLM group.
openshift_with_stack.shis the only file in the repo using the ambiguous short name.Testing
wait_for_subscription_csvreturns on its first poll and the install proceeds to step 3.bash -n tools/cluster_setup/openshift_with_stack.shpasses.🤖 Generated with Claude Code