🌱 fix(e2e): use per-component namespaces in HA and upgrade steps#2685
Conversation
The e2e test infrastructure assumed all OLM components (operator-controller and catalogd) live in the same namespace, but some distributions deploy them in separate namespaces. This caused the HA scenario to fail because ComponentIsReadyToReconcile searched for the catalogd deployment in the operator-controller namespace. detectOLMDeployments now returns both deployments from a single API call, and BeforeSuite populates a componentNamespaces map so each component's operations (deployment lookup, rollout, lease, logs, pod fetch) use the correct namespace. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Todd Short <tshort@redhat.com>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Updates the e2e upgrade/HA step implementations to handle environments where OLM components (operator-controller and catalogd) are deployed into different namespaces, avoiding incorrect lookups that previously assumed a single shared namespace.
Changes:
- Add per-component namespace resolution via a
componentNamespacesmap andnamespaceForComponent()fallback helper. - Update upgrade reconciliation checks (deployment rollout, leader lease lookup, logs, pod fetch) to use per-component namespaces.
- Enhance OLM deployment detection to return both operator-controller and catalogd deployments from a single cluster-wide query and seed namespace mapping in
BeforeSuite.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/e2e/steps/upgrade_steps.go | Use per-component namespaces for rollout/lease/log/pod checks during upgrade steps. |
| test/e2e/steps/steps.go | Introduce catalogdDeploymentName, componentNamespaces, and namespaceForComponent() helper. |
| test/e2e/steps/hooks.go | Replace single-deployment detection with detectOLMDeployments() and populate component namespace mapping in BeforeSuite. |
| test/e2e/steps/ha_steps.go | Update HA steps to operate on catalogd resources in the correct namespace. |
Comments suppressed due to low confidence (1)
test/e2e/steps/upgrade_steps.go:37
- In upgrade scenarios where OLM is installed in a Background step (BeforeSuite returns early because deployments aren’t present yet),
installOperator()updatesolmNamespacebut never populatescomponentNamespaces. As a result,namespaceForComponent("catalogd")will still fall back toolmNamespace, reintroducing the original failure when catalogd runs in a separate namespace. Consider updatinginstallOperator()to also setcomponentNamespaces["operator-controller"]andcomponentNamespaces["catalogd"](using thecatalogdDepreturn fromdetectOLMDeployments()), or factoring the namespace-detection into a shared helper that both BeforeSuite and installOperator call.
installOperator = sync.OnceValue(func() error {
err := runInstallScript("RELEASE_INSTALL")
if err != nil {
return err
}
olm, _, err := detectOLMDeployments()
if err != nil {
return err
}
olmNamespace = olm.Namespace
return nil
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2685 +/- ##
=======================================
Coverage 68.10% 68.10%
=======================================
Files 145 145
Lines 10700 10700
=======================================
Hits 7287 7287
Misses 2885 2885
Partials 528 528
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pedjak The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e0f05f9
into
operator-framework:main
The e2e test infrastructure assumed all OLM components (operator-controller and catalogd) live in the same namespace, but some distributions deploy them in separate namespaces. This caused the HA scenario to fail because ComponentIsReadyToReconcile searched for the catalogd deployment in the operator-controller namespace.
detectOLMDeployments now returns both deployments from a single API call, and BeforeSuite populates a componentNamespaces map so each component's operations (deployment lookup, rollout, lease, logs, pod fetch) use the correct namespace.
Description
Reviewer Checklist