Skip to content

🌱 fix(e2e): use per-component namespaces in HA and upgrade steps#2685

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
tmshort:fix-e2e-namespace
Apr 30, 2026
Merged

🌱 fix(e2e): use per-component namespaces in HA and upgrade steps#2685
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
tmshort:fix-e2e-namespace

Conversation

@tmshort
Copy link
Copy Markdown
Contributor

@tmshort tmshort commented Apr 30, 2026

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

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

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>
Copilot AI review requested due to automatic review settings April 30, 2026 15:26
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 30, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 7d657f6
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69f374b9183d9c000a3b651f
😎 Deploy Preview https://deploy-preview-2685--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 componentNamespaces map and namespaceForComponent() 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() updates olmNamespace but never populates componentNamespaces. As a result, namespaceForComponent("catalogd") will still fall back to olmNamespace, reintroducing the original failure when catalogd runs in a separate namespace. Consider updating installOperator() to also set componentNamespaces["operator-controller"] and componentNamespaces["catalogd"] (using the catalogdDep return from detectOLMDeployments()), 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
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.10%. Comparing base (09ccf9e) to head (7d657f6).
⚠️ Report is 1 commits behind head on main.

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           
Flag Coverage Δ
e2e 37.14% <ø> (-0.03%) ⬇️
experimental-e2e 52.48% <ø> (+0.02%) ⬆️
unit 53.79% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 30, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 30, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 30, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit e0f05f9 into operator-framework:main Apr 30, 2026
29 checks passed
@tmshort tmshort deleted the fix-e2e-namespace branch April 30, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants