Skip to content

OCPCLOUD-3570: e2e skip Cluster API authoritative MachineSets in GetFirstMAPIMachineSet#610

Open
pmeida wants to merge 1 commit into
openshift:mainfrom
pmeida:fix-get-first-mapi-machineset
Open

OCPCLOUD-3570: e2e skip Cluster API authoritative MachineSets in GetFirstMAPIMachineSet#610
pmeida wants to merge 1 commit into
openshift:mainfrom
pmeida:fix-get-first-mapi-machineset

Conversation

@pmeida

@pmeida pmeida commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

GetFirstMAPIMachineSet sorts all mapiv1beta1.MachineSet objects in openshift-machine-api alphabetically and returns the first. When migration tests run, the machine sync controller creates genuine MAPI MachineSet objects as mirrors of CAPI-authoritative MachineSets (e.g. capi-ms-auth-capi-*). These names sort before native worker MachineSets, causing the function to return a synced mirror. getMAPICreatedInstance then fails to find MAPI Machine objects for it because the machines are provisioned by CAPI, not MAPI.

Filter to skip MachineSets where Spec.AuthoritativeAPI == ClusterAPI. Spec is used instead of Status because the status is set by the migration controller after reconciliation and may be empty on freshly created objects.

Observed failure:

Failed to find MAPI machines for MachineSet capi-ms-auth-capi-wqbkl
Expected []v1beta1.Machine | len:0, cap:0 not to be empty

This proves that function GetFirstMAPIMachineSet returned a MachineSet named capi-ms-auth-capi-wqbkl. The name itself (capi-ms prefix, auth-capi = CAPI authoritative) is self-documenting - it's a CAPI-synced mirror that was picked up from the MAPI namespace

Example run: pull-ci-openshift-cluster-capi-operator-main-e2e-aws-capi-techpreview #2070173165606146048

Test plan

  • e2e-aws-capi-techpreview passes without the flake

Summary by CodeRabbit

  • Bug Fixes
    • Improved machine selection so the first eligible MachineSet is chosen after sorting, skipping entries authored by Cluster API.
    • Added a clearer failure when no suitable MachineSet is available, reducing unexpected test behavior.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: bdcde4bb-5b3f-4e34-bf15-cffefec37436

📥 Commits

Reviewing files that changed from the base of the PR and between b92961d and cf9bc23.

📒 Files selected for processing (1)
  • e2e/framework/providerspec.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • e2e/framework/providerspec.go

Walkthrough

GetFirstMAPIMachineSet now skips MachineSets authored by Cluster API, returning the first remaining sorted entry and failing the test if none exist.

Changes

MachineSet selection

Layer / File(s) Summary
First non-Cluster API MachineSet
e2e/framework/providerspec.go
GetFirstMAPIMachineSet now iterates the sorted MachineSet list, skips MachineAuthorityClusterAPI entries, and fails the Ginkgo test when no matching MachineSet is found.

Estimated review effort

🎯 2 (Simple) | ⏱️ ~5–15 minutes

Suggested labels

verified

Suggested reviewers

  • racheljpg
  • RadekManak
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: skipping Cluster API-authoritative MachineSets in GetFirstMAPIMachineSet.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR only updates a helper in e2e/framework/providerspec.go; it adds no Ginkgo It/Describe/Context/When titles, so no unstable test names were introduced.
Test Structure And Quality ✅ Passed PASS: The PR only changes a shared e2e helper, not any Ginkgo It blocks; its Expect/Fail calls already include clear messages and no new waits are added.
Microshift Test Compatibility ✅ Passed PR only changes a helper in e2e/framework; it adds no new Ginkgo It/Describe blocks or MicroShift-sensitive test logic.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Only e2e/framework/providerspec.go changed; it’s a helper, not a new Ginkgo test, and it adds no multi-node or SNO-sensitive assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The change only filters MachineSets in an e2e helper; it adds no pod scheduling constraints or topology assumptions.
Ote Binary Stdout Contract ✅ Passed The touched helper is pure test logic; no main/init/suite setup stdout writes were introduced, and suite diagnostics go to GinkgoWriter/stderr.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only the helper GetFirstMAPIMachineSet changed; no new Ginkgo tests or IPv4/public-internet assumptions were added, so the compatibility check is not triggered.
No-Weak-Crypto ✅ Passed Changed code only filters MachineSets by AuthoritativeAPI; no weak crypto, custom crypto, or secret comparisons were introduced.
Container-Privileges ✅ Passed PASS: The PR only changes an e2e Go helper; no container/K8s manifest privilege settings (privileged, hostPID, allowPrivilegeEscalation, SYS_ADMIN, root) are introduced.
No-Sensitive-Data-In-Logs ✅ Passed The change adds no logging and only a generic Ginkgo Fail message; it doesn’t expose secrets, PII, hostnames, or customer data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci openshift-ci Bot requested review from mdbooth and theobarberbany June 25, 2026 18:36
@pmeida pmeida changed the title e2e: skip Cluster API authoritative MachineSets in GetFirstMAPIMachineSet OCPCLOUD-3570: e2e skip Cluster API authoritative MachineSets in GetFirstMAPIMachineSet Jun 25, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 25, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 25, 2026

Copy link
Copy Markdown

@pmeida: This pull request references OCPCLOUD-3570 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

GetFirstMAPIMachineSet sorts all mapiv1beta1.MachineSet objects in openshift-machine-api alphabetically and returns the first. When migration tests run, the machine sync controller creates genuine MAPI MachineSet objects as mirrors of CAPI-authoritative MachineSets (e.g. capi-ms-auth-capi-*). These names sort before native worker MachineSets, causing the function to return a synced mirror. getMAPICreatedInstance then fails to find MAPI Machine objects for it because the machines are provisioned by CAPI, not MAPI.

Filter to skip MachineSets where Spec.AuthoritativeAPI == ClusterAPI. Spec is used instead of Status because the status is set by the migration controller after reconciliation and may be empty on freshly created objects.

Observed failure:

Failed to find MAPI machines for MachineSet capi-ms-auth-capi-wqbkl
Expected []v1beta1.Machine | len:0, cap:0 not to be empty

Example run: pull-ci-openshift-cluster-capi-operator-main-e2e-aws-capi-techpreview #2070173165606146048

Test plan

  • e2e-aws-capi-techpreview passes without the flake

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@pmeida

pmeida commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-capi-techpreview

Comment thread e2e/framework/providerspec.go
Comment thread e2e/framework/providerspec.go Outdated

@damdo damdo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!!
One style nit

/approve

@openshift-ci

openshift-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damdo

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 Jun 26, 2026
…eSet

When migration tests run, the machine sync controller creates genuine
mapiv1beta1.MachineSet objects in the MAPI namespace as mirrors of
CAPI-authoritative MachineSets. These synced mirrors have names (e.g.
capi-ms-auth-capi-*) that sort before native worker MachineSets, causing
GetFirstMAPIMachineSet to return one of them. getMAPICreatedInstance then
fails to find MAPI Machine objects for it because the machines are
provisioned by CAPI, not MAPI.

Filter to skip MachineSets where Spec.AuthoritativeAPI == ClusterAPI.
Spec is used instead of Status because the status is set by the migration
controller after reconciliation and may be empty on freshly created objects.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@pmeida pmeida force-pushed the fix-get-first-mapi-machineset branch from b92961d to cf9bc23 Compare June 26, 2026 10:08
@damdo

damdo commented Jun 26, 2026

Copy link
Copy Markdown
Member

/test e2e-aws-capi-techpreview

@damdo

damdo commented Jun 26, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
@damdo

damdo commented Jun 26, 2026

Copy link
Copy Markdown
Member

/verified by ci

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 26, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@damdo: This PR has been marked as verified by ci.

Details

In response to this:

/verified by ci

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@damdo

damdo commented Jun 26, 2026

Copy link
Copy Markdown
Member

/pipeline ?

@damdo

damdo commented Jun 26, 2026

Copy link
Copy Markdown
Member

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-capi-disconnected-techpreview
/test e2e-aws-capi-techpreview
/test e2e-aws-capi-techpreview-post-install
/test e2e-aws-ovn-techpreview
/test e2e-aws-ovn-techpreview-upgrade
/test e2e-azure-capi-techpreview
/test e2e-azure-ovn-techpreview
/test e2e-azure-ovn-techpreview-upgrade
/test e2e-gcp-capi-techpreview
/test e2e-gcp-ovn-techpreview
/test e2e-metal3-capi-techpreview
/test e2e-openstack-capi-techpreview
/test e2e-vsphere-capi-techpreview
/test regression-clusterinfra-aws-ipi-techpreview-capi

@damdo

damdo commented Jun 26, 2026

Copy link
Copy Markdown
Member

/retest

1 similar comment
@pmeida

pmeida commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@pmeida: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-ovn-techpreview cf9bc23 link true /test e2e-gcp-ovn-techpreview
ci/prow/e2e-aws-ovn-techpreview cf9bc23 link true /test e2e-aws-ovn-techpreview

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants