Skip to content

WIP: 🌱 Remove BMO in the preCleanupManagementCluster function. - #3535

Open
UncivilizedGhost wants to merge 1 commit into
metal3-io:mainfrom
Nordix:saad/clean_bmo
Open

WIP: 🌱 Remove BMO in the preCleanupManagementCluster function.#3535
UncivilizedGhost wants to merge 1 commit into
metal3-io:mainfrom
Nordix:saad/clean_bmo

Conversation

@UncivilizedGhost

Copy link
Copy Markdown
Member

What this PR does / why we need itPrevents error spam in the console log when the log collectors are trying to get logs from the non-existing cluster in clusterctl-upgrade tests:

Fixes #2460

Checklist:

  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • E2E tests have been added, if necessary.
  • Integration tests have been added, if necessary.

@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2026
@metal3-io-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign smoshiur1237 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test ?

@metal3-io-bot metal3-io-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 8, 2026
@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main
/test metal3-ubuntu-e2e-integration-test-main
/test metal3-centos-e2e-integration-test-main

@metal3-io-bot metal3-io-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 8, 2026
@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main
/test metal3-ubuntu-e2e-integration-test-main
/test metal3-centos-e2e-integration-test-main

@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/copilot-review

@metal3-io-bot
metal3-io-bot requested a review from Copilot July 9, 2026 08:11
@metal3-io-bot

Copy link
Copy Markdown
Contributor

Copilot code review has been requested by @UncivilizedGhost. Please allow a few moments for the review to be added.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates CAPM3’s E2E test helpers/hooks to reduce noisy log-collection errors during clusterctl-upgrade scenarios by avoiding long-lived deployment log watchers and explicitly removing BMO before the management cluster is torn down.

Changes:

  • Added a WatchLogs toggle to InstallIRSO so callers can disable deployment log watching.
  • Disabled deployment log watching for IRSO and BMO installs in clusterctl-upgrade tests.
  • Added an explicit BMO Deployment deletion step in preCleanupManagementCluster to reduce log-collector errors when the management cluster is being deleted.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/e2e/common.go Adds InstallIRSOInput.WatchLogs and wires it into BuildAndApplyKustomization to control deployment log watching.
test/e2e/upgrade_clusterctl_test.go Disables IRSO/BMO deployment log watching during upgrade tests and removes the BMO Deployment during management-cluster pre-cleanup.
test/e2e/pivoting.go Updates IRSO installs to explicitly set WatchLogs: true after the new input field was introduced.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@metal3-io-bot metal3-io-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 9, 2026
@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main
/test metal3-ubuntu-e2e-integration-test-main
/test metal3-centos-e2e-integration-test-main

@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main
/test metal3-ubuntu-e2e-integration-test-main
/test metal3-centos-e2e-integration-test-main

@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main
/test metal3-ubuntu-e2e-integration-test-main

@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main

@UncivilizedGhost

Copy link
Copy Markdown
Member Author

Trying to remove BMO doesn't work since watchers still exist. I'm trying to manually suppress the errors to see if that can do something.

/test metal3-e2e-clusterctl-upgrade-test-main

@metal3-io-bot metal3-io-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 17, 2026
@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main
/test metal3-ubuntu-e2e-integration-test-main
/test metal3-centos-e2e-integration-test-main

@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main
/test metal3-ubuntu-e2e-integration-test-main
/test metal3-centos-e2e-integration-test-main

Prevents error spam in the console log when the log collectors
are trying to get logs from the non-existing cluster in clusterctl-upgrade tests

Signed-off-by: Saad Zia <saad.zia@est.tech>
@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main
/test metal3-ubuntu-e2e-integration-test-main
/test metal3-centos-e2e-integration-test-main

@UncivilizedGhost

Copy link
Copy Markdown
Member Author

\copilot-review

@UncivilizedGhost

Copy link
Copy Markdown
Member Author

/copilot-review

@metal3-io-bot
metal3-io-bot requested a review from Copilot August 3, 2026 10:08
@metal3-io-bot

Copy link
Copy Markdown
Contributor

Copilot code review has been requested by @UncivilizedGhost. Please allow a few moments for the review to be added.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (3)

test/e2e/pivoting.go:330

  • Foreground propagation controls garbage-collection order, but the DELETE request still returns as soon as deletion is accepted; it does not wait for the Deployment or its Pods to disappear. Consequently the new cleanup callers can continue to management-cluster teardown while BMO is still running, so this does not guarantee the behavior needed to prevent the log spam. After issuing the delete, poll until the Deployment is NotFound (using a configured cleanup interval) before returning.
	// Use foreground propagation so the deployment's pods are deleted as part of
	// the delete instead of being orphaned and cleaned up asynchronously.
	foregroundDeletion := metav1.DeletePropagationForeground
	err := input.ClusterProxy.GetClientSet().AppsV1().
		Deployments(input.Namespace).
		Delete(ctx, input.Name, metav1.DeleteOptions{
			PropagationPolicy: &foregroundDeletion,
		})

test/e2e/upgrade_clusterctl_test.go:53

  • This unrelated replacement removes the v1.13/BMO 0.13/Ironic 35 → current upgrade scenario, while the following spec already exercises v1.12 → main. The PR and issue only describe teardown log spam, so this silently drops the newer release-to-current coverage. Restore the v1.13 scenario, or move and explain this test-matrix change separately.
// Ironic 33.0 -> 35.0.
var _ = Describe("When testing cluster upgrade from releases (v1.12=>current)", Label("clusterctl-upgrade"), func() {
	minorVersion := "1.12"
	bmoFromRelease := "0.12"
	ironicFromRelease := "33.0"
	bmoToRelease := "0.13"
	ironicToRelease := "35.0"

scripts/ci-e2e.sh:300

  • This filter wraps the entire E2E run, not just teardown, and generic alternatives such as reflector.go, Unhandled Error, and client connection lost will hide genuine API/informer failures during provisioning or test execution. That removes precisely the diagnostics needed to investigate flakes. Preserve the unfiltered output (or remove this wrapper now that the caches are explicitly cancelled) and only filter a derived teardown-specific view if necessary.
E2E_LOG_FILTER='reflector\.go|Failed to watch \*v1\.Pod|failed to list \*v1\.Pod|watch of \*v1\.Pod ended|Unhandled Error|client connection lost|Error starting logs stream for pod'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spammy log collectors in clusterctl-upgrade tests

3 participants