Skip to content

OCPBUGS-100246: Fix e2es on CAPI-native clusters - #641

Open
mdbooth wants to merge 2 commits into
openshift:mainfrom
openshift-cloud-team:OCPBUGS-100246
Open

OCPBUGS-100246: Fix e2es on CAPI-native clusters#641
mdbooth wants to merge 2 commits into
openshift:mainfrom
openshift-cloud-team:OCPBUGS-100246

Conversation

@mdbooth

@mdbooth mdbooth commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Fixes tests which assume there is at least one MAPI machineset created by openshift-installer which they can use as a template for creating new MachineSets.

Rewrites the Cluster API AWS MachineSet suite, because it no longer makes sense in the context of a CAPI native cluster. Retains the verifyCAPIInstanceOwnershipTag test as a separate test, but skips the compareInstances test because:

  • there's nothing to compare against
  • it's the default worker machineset, so the conformance tests will confirm it's correct

TODO:

/hold

Summary by CodeRabbit

  • Bug Fixes

    • Improved AWS machine discovery across native and migration scenarios.
    • Updated machine matching to support multiple valid matches and clearer failure reporting.
    • Improved fallback handling when a live worker resource is unavailable.
  • Tests

    • Expanded end-to-end coverage for Machine API migrations.
    • Added validation of AWS ownership tags and cross-provider instance comparisons.
    • Improved test setup, cleanup, and resource selection for more reliable results.

mdbooth added 2 commits July 31, 2026 16:07
Fixes tests which assume there is at least one MAPI machineset created
by openshift-installer which they can use as a template for creating new
MachineSets.

Rewrites the Cluster API AWS MachineSet suite, because it no longer
makes sense in the context of a CAPI native cluster. Retains the
verifyCAPIInstanceOwnershipTag test as a separate test, but skips the
compareInstances test because:
* there's nothing to compare against
* it's the default worker machineset, so the conformance tests will
  confirm it's correct
@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

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 31, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jul 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@mdbooth: This pull request references Jira Issue OCPBUGS-100246, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Fixes tests which assume there is at least one MAPI machineset created by openshift-installer which they can use as a template for creating new MachineSets.

Rewrites the Cluster API AWS MachineSet suite, because it no longer makes sense in the context of a CAPI native cluster. Retains the verifyCAPIInstanceOwnershipTag test as a separate test, but skips the compareInstances test because:

  • there's nothing to compare against
  • it's the default worker machineset, so the conformance tests will confirm it's correct

TODO:

/hold

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.

@openshift-ci
openshift-ci Bot requested review from damdo and racheljpg July 31, 2026 19:46
@openshift-ci

openshift-ci Bot commented Jul 31, 2026

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 radekmanak 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

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Walkthrough

Changes

The AWS e2e tests now support native and Machine API migration scenarios. They discover MAPI and CAPI worker MachineSets, select resources by migration authority, resolve the AWS region, and validate instances and ownership tags. Shared scheme registration, fallback discovery, machine creation, and module dependencies were updated.

AWS Machine Migration E2E Support

Layer / File(s) Summary
CAPI scheme and MachineSet discovery
e2e/e2e_common.go, e2e/framework/providerspec.go
The shared scheme registers CAPI v1beta1 types. MachineSet discovery delegates to the shared framework and supports CAPI fallback behavior.
Migration machine template selection
e2e/machine_migration_helpers.go
MAPI machine creation copies the template from a discovered worker MachineSet and uses the MAPI namespace.
AWS migration test flow
e2e/aws_helpers.go, e2e/aws_test.go
AWS setup selects MAPI or CAPI resources, creates temporary resources when required, resolves the region, waits for provisioning, and validates instances and ownership tags.
Dependency alignment
e2e/go.mod, go.mod, hack/tools/go.mod, manifests-gen/go.mod, openshift-tests-extension/go.mod
Module replacements and dependency versions were updated across the repository modules.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AWSMigrationTests
  participant FeatureGate
  participant KubernetesAPI
  participant AWSCluster
  participant AWSClient
  AWSMigrationTests->>FeatureGate: Read MachineAPIMigration authority
  AWSMigrationTests->>KubernetesAPI: Discover MAPI and CAPI worker MachineSets
  AWSMigrationTests->>KubernetesAPI: Create temporary CAPI MachineSet when required
  AWSMigrationTests->>AWSCluster: Read CAPI AWSCluster region when needed
  AWSMigrationTests->>AWSClient: Initialize client for selected region
  AWSMigrationTests->>AWSClient: Compare instances and verify ownership tags
Loading

Suggested reviewers: damdo

🚥 Pre-merge checks | ✅ 5 | ❌ 10

❌ Failed checks (10 inconclusive)

Check name Status Explanation Resolution
Stable And Deterministic Test Names ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Test Structure And Quality ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Microshift Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Single Node Openshift (Sno) Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Topology-Aware Scheduling Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Ote Binary Stdout Contract ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Ipv6 And Disconnected Network Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No-Weak-Crypto ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Container-Privileges ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No-Sensitive-Data-In-Logs ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (5 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 primary change: fixing end-to-end tests for CAPI-native clusters.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Tools execution failed with the following error:

Failed to run tools: Ping-pong health check failed


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

@mdbooth

mdbooth commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/pipeline auto

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

The pipeline-auto label has been added to this PR. Second-stage tests will be triggered automatically when all first-stage tests pass.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
e2e/aws_test.go (1)

22-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consolidate duplicate aliases for the same package.

machinev1 (line 23) and mapiv1beta1 (line 24) both alias github.com/openshift/api/machine/v1beta1. Both aliases are used for the same underlying types throughout the file (for example, mapiv1beta1.MachineSet and machinev1.MachineSet are identical types). This compiles, but it makes the MAPI/CAPI type juggling in this file harder to follow. Use a single alias for this package.

Please confirm that importing the same package path twice under different local names is intentional and not left over from a refactor; if not intentional, consolidate to one alias (for example machinev1) throughout the file.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/aws_test.go` around lines 22 - 34, Consolidate the duplicate imports of
github.com/openshift/api/machine/v1beta1 in the e2e test: retain a single alias,
preferably machinev1, and update all references currently using mapiv1beta1 to
that alias while preserving the existing type behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/aws_helpers.go`:
- Around line 142-144: Update the failure message in the Eventually assertion
for capiMachineList to include the missing “find” verb, changing it to “Failed
to find at least one CAPI AWSMachine for MachineSet %s” while preserving the
existing formatting and assertion behavior.

In `@e2e/aws_test.go`:
- Around line 148-155: Update createCAPIMachineSetFromMAPI so DeferCleanup is
registered only when cl.Create successfully creates awsMachineTemplate; keep
cleanup unregistered when the error is apierrors.IsAlreadyExists, while
preserving failure handling for all other errors.

In `@e2e/machine_migration_helpers.go`:
- Line 152: Update the assertion message for referenceMachineSet to use the full
user-facing names “Machine API” and “Cluster API” instead of the abbreviations
“MAPI” and “CAPI”, while preserving the existing assertion behavior.

---

Nitpick comments:
In `@e2e/aws_test.go`:
- Around line 22-34: Consolidate the duplicate imports of
github.com/openshift/api/machine/v1beta1 in the e2e test: retain a single alias,
preferably machinev1, and update all references currently using mapiv1beta1 to
that alias while preserving the existing type behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: af715b86-f68a-4e9e-a350-dee92b1c8367

📥 Commits

Reviewing files that changed from the base of the PR and between b05f43c and 62f9b38.

⛔ Files ignored due to path filters (120)
  • e2e/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
  • go.work.sum is excluded by !**/*.sum
  • hack/tools/go.sum is excluded by !**/*.sum
  • manifests-gen/go.sum is excluded by !**/*.sum
  • openshift-tests-extension/go.sum is excluded by !**/*.sum
  • vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/enums.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/smithy-go/CHANGELOG.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/smithy-go/README.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/smithy-go/go_module_metadata.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/smithy-go/middleware/eventstream_middleware.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/fatih/color/color.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/fatih/color/color_windows.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/hashicorp/go-version/CHANGELOG.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/hashicorp/go-version/README.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/hashicorp/go-version/version.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/onsi/gomega/CHANGELOG.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/onsi/gomega/README.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/onsi/gomega/format/format.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/onsi/gomega/gomega_dsl.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/onsi/gomega/matchers.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_a_slice_matcher.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_an_array_matcher.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/onsi/gomega/types/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/scheduler.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/parallel.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/framework/capi_helpers.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/framework/capi_machinesets.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/framework/machinesets.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/cluster-api-actuator-pkg/testutils/Makefile is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1/clusterautoscaler_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/machine-api-operator/pkg/webhooks/machine_webhook.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/machine-api-operator/pkg/webhooks/machineset_webhook.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/machine-api-operator/pkg/webhooks/vap.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/.golangci.yml is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/AGENTS.md is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/CHANGELOG.md is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/CLAUDE.md is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/CONTRIBUTING.md is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/Makefile is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/RELEASING.md is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/attribute/encoder.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/attribute/hash.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/attribute/key.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/attribute/kv.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/attribute/set.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/attribute/type_string.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/attribute/value.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/baggage/baggage.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/dependencies.Dockerfile is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/metric/asyncint64.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/metric/config.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/metric/doc.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/metric/instrument.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/metric/syncfloat64.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/metric/syncint64.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/propagation/baggage.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.37.0/attribute_group.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.39.0/attribute_group.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.39.0/httpconv/metric.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.39.0/otelconv/metric.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.39.0/rpcconv/metric.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.40.0/README.md is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.41.0/MIGRATION.md is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.41.0/README.md is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.41.0/attribute_group.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.41.0/doc.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.41.0/error_type.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.41.0/exception.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/semconv/v1.41.0/schema.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/trace/auto.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/trace/config.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/trace/internal/telemetry/span.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/trace/trace.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/version.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.opentelemetry.io/otel/versions.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/golang.org/x/mod/modfile/read.go is excluded by !**/vendor/**, !vendor/**
  • vendor/golang.org/x/mod/modfile/rule.go is excluded by !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/checked.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/eval.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/explain.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/syntax.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/value.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go is excluded by !**/*.pb.go, !**/vendor/**, !vendor/**
  • vendor/k8s.io/utils/strings/slices/slices.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/README.md is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/env/env.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/env/exit.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/env/helpers.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/main.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/remote/http_client.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/remote/read_body.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/store/store.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/version/version.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/versions/version.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest/workflows/workflows.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/element.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/pathelementmap.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/set.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/structured-merge-diff/v6/value/allocator.go is excluded by !**/vendor/**, !vendor/**
  • vendor/sigs.k8s.io/structured-merge-diff/v6/value/jsontagutil.go is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (10)
  • e2e/aws_helpers.go
  • e2e/aws_test.go
  • e2e/e2e_common.go
  • e2e/framework/providerspec.go
  • e2e/go.mod
  • e2e/machine_migration_helpers.go
  • go.mod
  • hack/tools/go.mod
  • manifests-gen/go.mod
  • openshift-tests-extension/go.mod

Comment thread e2e/aws_helpers.go
Comment on lines 142 to +144
Eventually(komega.ObjectList(capiMachineList, client.InNamespace(framework.CAPINamespace), client.MatchingLabels{
machineSetOpenshiftLabelKey: msName,
})).Should(HaveField("Items", HaveLen(1)), "Failed to find exactly one CAPI AWSMachine for MachineSet %s", msName)
clusterv1.MachineSetNameLabel: msName,
})).Should(HaveField("Items", Not(BeEmpty())), "Failed to at least one CAPI AWSMachine for MachineSet %s", msName)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the failure message grammar.

The message "Failed to at least one CAPI AWSMachine for MachineSet %s" omits a verb. Use "Failed to find at least one CAPI AWSMachine for MachineSet %s" so the test failure output reads correctly.

✏️ Proposed fix
-	})).Should(HaveField("Items", Not(BeEmpty())), "Failed to at least one CAPI AWSMachine for MachineSet %s", msName)
+	})).Should(HaveField("Items", Not(BeEmpty())), "Failed to find at least one CAPI AWSMachine for MachineSet %s", msName)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Eventually(komega.ObjectList(capiMachineList, client.InNamespace(framework.CAPINamespace), client.MatchingLabels{
machineSetOpenshiftLabelKey: msName,
})).Should(HaveField("Items", HaveLen(1)), "Failed to find exactly one CAPI AWSMachine for MachineSet %s", msName)
clusterv1.MachineSetNameLabel: msName,
})).Should(HaveField("Items", Not(BeEmpty())), "Failed to at least one CAPI AWSMachine for MachineSet %s", msName)
Eventually(komega.ObjectList(capiMachineList, client.InNamespace(framework.CAPINamespace), client.MatchingLabels{
clusterv1.MachineSetNameLabel: msName,
})).Should(HaveField("Items", Not(BeEmpty())), "Failed to find at least one CAPI AWSMachine for MachineSet %s", msName)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/aws_helpers.go` around lines 142 - 144, Update the failure message in the
Eventually assertion for capiMachineList to include the missing “find” verb,
changing it to “Failed to find at least one CAPI AWSMachine for MachineSet %s”
while preserving the existing formatting and assertion behavior.

Comment thread e2e/aws_test.go
Comment on lines +148 to +155
func createCAPIMachineSetFromMAPI(mapiMachineSet *mapiv1beta1.MachineSet) *clusterv1.MachineSet {
awsMachineTemplate := newAWSMachineTemplate(mapiMachineSet, infra)
if err := cl.Create(ctx, awsMachineTemplate); err != nil && !apierrors.IsAlreadyExists(err) {
Expect(err).ToNot(HaveOccurred(), "should not fail creating AWS machine template")
}
DeferCleanup(func() {
framework.DeleteObjects(ctx, cl, awsMachineTemplate)
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Only clean up the AWS machine template this test creates.

cl.Create tolerates apierrors.IsAlreadyExists(err), meaning the template may already exist and was not created by this test. Despite that, DeferCleanup unconditionally deletes awsMachineTemplate. If the template already existed and is owned by another resource (an existing worker MachineSet, or an automatic MAPI-to-CAPI sync mechanism), this cleanup deletes a resource this test does not own, and can break that other resource's reconciliation.

Register the cleanup only when this call actually created the object.

🛡️ Proposed fix
-	awsMachineTemplate := newAWSMachineTemplate(mapiMachineSet, infra)
-	if err := cl.Create(ctx, awsMachineTemplate); err != nil && !apierrors.IsAlreadyExists(err) {
-		Expect(err).ToNot(HaveOccurred(), "should not fail creating AWS machine template")
-	}
-	DeferCleanup(func() {
-		framework.DeleteObjects(ctx, cl, awsMachineTemplate)
-	})
+	awsMachineTemplate := newAWSMachineTemplate(mapiMachineSet, infra)
+	err := cl.Create(ctx, awsMachineTemplate)
+	if err != nil && !apierrors.IsAlreadyExists(err) {
+		Expect(err).ToNot(HaveOccurred(), "should not fail creating AWS machine template")
+	}
+	if err == nil {
+		DeferCleanup(func() {
+			framework.DeleteObjects(ctx, cl, awsMachineTemplate)
+		})
+	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func createCAPIMachineSetFromMAPI(mapiMachineSet *mapiv1beta1.MachineSet) *clusterv1.MachineSet {
awsMachineTemplate := newAWSMachineTemplate(mapiMachineSet, infra)
if err := cl.Create(ctx, awsMachineTemplate); err != nil && !apierrors.IsAlreadyExists(err) {
Expect(err).ToNot(HaveOccurred(), "should not fail creating AWS machine template")
}
DeferCleanup(func() {
framework.DeleteObjects(ctx, cl, awsMachineTemplate)
})
func createCAPIMachineSetFromMAPI(mapiMachineSet *mapiv1beta1.MachineSet) *clusterv1.MachineSet {
awsMachineTemplate := newAWSMachineTemplate(mapiMachineSet, infra)
err := cl.Create(ctx, awsMachineTemplate)
if err != nil && !apierrors.IsAlreadyExists(err) {
Expect(err).ToNot(HaveOccurred(), "should not fail creating AWS machine template")
}
if err == nil {
DeferCleanup(func() {
framework.DeleteObjects(ctx, cl, awsMachineTemplate)
})
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/aws_test.go` around lines 148 - 155, Update createCAPIMachineSetFromMAPI
so DeferCleanup is registered only when cl.Create successfully creates
awsMachineTemplate; keep cleanup unregistered when the error is
apierrors.IsAlreadyExists, while preserving failure handling for all other
errors.

// MachineSet exists.
referenceMachineSet, err := mapiframework.GetSampleMAPIWorkerMachineSet(ctx, cl)
Expect(err).ToNot(HaveOccurred(), "getting a sample worker MachineSet should not error")
Expect(referenceMachineSet).ToNot(BeNil(), "expected to find a MAPI or CAPI worker MachineSet")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use full API names in the assertion message.

Line 152 exposes MAPI and CAPI when the assertion fails. Replace them with Machine API and Cluster API.

As per coding guidelines, “For user-facing text like logs and errors, use 'Cluster API' and 'Machine API'.”

Proposed fix
-	Expect(referenceMachineSet).ToNot(BeNil(), "expected to find a MAPI or CAPI worker MachineSet")
+	Expect(referenceMachineSet).ToNot(BeNil(), "expected to find a Machine API or Cluster API worker MachineSet")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Expect(referenceMachineSet).ToNot(BeNil(), "expected to find a MAPI or CAPI worker MachineSet")
Expect(referenceMachineSet).ToNot(BeNil(), "expected to find a Machine API or Cluster API worker MachineSet")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/machine_migration_helpers.go` at line 152, Update the assertion message
for referenceMachineSet to use the full user-facing names “Machine API” and
“Cluster API” instead of the abbreviations “MAPI” and “CAPI”, while preserving
the existing assertion behavior.

Source: Coding guidelines

@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

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@mdbooth: 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 62f9b38 link true /test e2e-gcp-ovn-techpreview
ci/prow/regression-clusterinfra-aws-ipi-techpreview-capi 62f9b38 link false /test regression-clusterinfra-aws-ipi-techpreview-capi

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

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. pipeline-auto

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants