Skip to content

NO-JIRA: Fix 2 failures in ci jobs#485

Open
sunzhaohua2 wants to merge 2 commits intoopenshift:mainfrom
sunzhaohua2:fix-secret-issue
Open

NO-JIRA: Fix 2 failures in ci jobs#485
sunzhaohua2 wants to merge 2 commits intoopenshift:mainfrom
sunzhaohua2:fix-secret-issue

Conversation

@sunzhaohua2
Copy link
Contributor

@sunzhaohua2 sunzhaohua2 commented Mar 3, 2026

The first error:
2026-03-02T09:31:33Z AWSMachine/machine-auth-capi-58g4d Warning FailedGetBootstrapData failed to retrieve bootstrap data secret for AWSMachine openshift-cluster-api/machine-auth-capi-58g4d: Secret "master...

Changed to use worker-user-data.

The second error:

11:51:47 MachineSet/zhsun-33-6c24v-worker-us-east-2a  SuccessfulAdopt   Adopted Machine "machine-vap-capi-forbidden-nztfj"
11:51:47 MachineSet/zhsun-33-6c24v-worker-us-east-2a  SuccessfulDelete  Deleted machine "machine-vap-capi-forbidden-nztfj"

Deleted machine.openshift.io/cluster-api-machineset label to prevent test Machines from being adopted and deleted by MachineSet controllers.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed label selection used to identify worker machines.
    • Prevented unintended MachineSet adoption by clearing problematic spec labels during machine creation.
  • Improvements

    • Tests now skip early when no worker machines are present, avoiding false failures.
    • Worker machine creation now uses updated bootstrap data configuration for newly created machines.

@openshift-ci-robot
Copy link

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

@sunzhaohua2 sunzhaohua2 changed the title Fix 2 failures in ci jobs NO-JIRA: Fix 2 failures in ci jobs Mar 3, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

📝 Walkthrough

Walkthrough

Changed CAPI machine selection to explicitly target worker-labeled machines, added a guard to skip tests when no worker CAPI machines exist, set bootstrap.DataSecretName for created CAPI machines, and clear specific MAPI spec.metadata.labels to prevent MachineSet adoption.

Changes

Cohort / File(s) Summary
Machine migration helpers
e2e/machine_migration_helpers.go
Replaced non-control-plane selection with worker-label existence check; added skipIfNoWorkerCAPIMachines(); refactored createCAPIMachine to fetch worker CAPI machines and set Spec.Bootstrap.DataSecretName = "worker-user-data"; clear spec.metadata.labels (remove machine.openshift.io/cluster-api-machineset, cluster.x-k8s.io/set-name) in MAPI creation path to avoid MachineSet adoption.
Tests
e2e/machine_migration_capi_authoritative_test.go
Added early call to skipIfNoWorkerCAPIMachines() in BeforeAll to skip the "Create MAPI Machine" context when no worker CAPI machines are present.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐇 I nibble at labels, tidy and neat,

Worker seeds found beneath my feet.
Bootstrap tucked in a secreted chest,
Tests skip softly when workers rest,
Hooray — no stray MachineSet guests!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive phrasing 'Fix 2 failures' without specifying what the actual changes are or which CI jobs are affected. Replace with a more specific title that describes the actual changes, such as 'Use worker-user-data for bootstrap and remove MachineSet labels to fix CI failures' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 3, 2026
@openshift-ci-robot
Copy link

@sunzhaohua2: This pull request explicitly references no jira issue.

Details

In response to this:

The first error:
2026-03-02T09:31:33Z AWSMachine/machine-auth-capi-58g4d Warning FailedGetBootstrapData failed to retrieve bootstrap data secret for AWSMachine openshift-cluster-api/machine-auth-capi-58g4d: Secret "master...

Changed to use worker-user-data.

The second error:

11:51:47 MachineSet/zhsun-33-6c24v-worker-us-east-2a  SuccessfulAdopt   Adopted Machine "machine-vap-capi-forbidden-nztfj"
11:51:47 MachineSet/zhsun-33-6c24v-worker-us-east-2a  SuccessfulDelete  Deleted machine "machine-vap-capi-forbidden-nztfj"

Deleted machine.openshift.io/cluster-api-machineset label to prevent test Machines from being adopted and deleted by MachineSet controllers.

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 theobarberbany March 3, 2026 06:10
@sunzhaohua2
Copy link
Contributor Author

/retest

1 similar comment
@sunzhaohua2
Copy link
Contributor Author

/retest

@theobarberbany
Copy link
Contributor

Aha! Nice to see this getting fixed :) Was the additional event data added on failure useful?

e.g:

[openshift-cluster-api] Events (last 10min, 1):
  2026-03-02T09:31:33Z AWSMachine/machine-auth-capi-58g4d Warning  FailedGetBootstrapData failed to retrieve bootstrap data secret for AWSMachine openshift-cluster-api/machine-auth-capi-58g4d: Secret "master...

/retest

@sunzhaohua2
Copy link
Contributor Author

Aha! Nice to see this getting fixed :) Was the additional event data added on failure useful?

Yes! Super useful, it makes debug easier. Thanks you!

@theobarberbany
Copy link
Contributor

/retest

@sunzhaohua2
Copy link
Contributor Author

/test images

@sunzhaohua2
Copy link
Contributor Author

/test ci/prow/e2e-aws-capi-techpreview

@sunzhaohua2
Copy link
Contributor Author

/test e2e-aws-capi-techpreview

Comment on lines +55 to +58
// Skip test if no worker CAPI machines exist to use as reference
if len(capiMachineList) == 0 {
Skip("No worker CAPI machines found in cluster. This test requires at least one existing worker CAPI machine as a reference.")
}
Copy link
Member

Choose a reason for hiding this comment

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

This createCAPIMachine is a helper right? Not sure it makes sense to skip a whole test independently of what it is, based on the fact that it uses this helper and the helper is unable to create a Machine because one does not exist already, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @damdo I have updated the pr, PTAL when you have a moment!

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

Left a question

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

92-92: Consider extracting magic string to a named constant.

The hardcoded "worker-user-data" secret name fixes the CI failure as intended. For maintainability, consider defining this as a package-level constant, making it easier to update if the secret name changes and improving discoverability.

Suggested constant definition
const workerBootstrapDataSecretName = "worker-user-data"

Then use ptr.To(workerBootstrapDataSecretName) on line 92.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/machine_migration_helpers.go` at line 92, Replace the hardcoded
"worker-user-data" string with a package-level constant (e.g., define const
workerBootstrapDataSecretName = "worker-user-data") and update the assignment to
newCapiMachine.Spec.Bootstrap.DataSecretName to use
ptr.To(workerBootstrapDataSecretName); this centralizes the magic string for
easier maintenance and discovery while keeping the existing assignment in the
newCapiMachine.Spec.Bootstrap.DataSecretName code path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@e2e/machine_migration_helpers.go`:
- Line 92: Replace the hardcoded "worker-user-data" string with a package-level
constant (e.g., define const workerBootstrapDataSecretName = "worker-user-data")
and update the assignment to newCapiMachine.Spec.Bootstrap.DataSecretName to use
ptr.To(workerBootstrapDataSecretName); this centralizes the magic string for
easier maintenance and discovery while keeping the existing assignment in the
newCapiMachine.Spec.Bootstrap.DataSecretName code path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ca9ff08d-ceeb-4f40-8e73-dc5f9ae180ea

📥 Commits

Reviewing files that changed from the base of the PR and between ff17838 and 69fbffb.

📒 Files selected for processing (2)
  • e2e/machine_migration_capi_authoritative_test.go
  • e2e/machine_migration_helpers.go

@sunzhaohua2
Copy link
Contributor Author

/test e2e-aws-capi-techpreview

@damdo
Copy link
Member

damdo commented Mar 10, 2026

/assign @damdo

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2026
@openshift-ci-robot
Copy link

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-capi-techpreview
/test e2e-aws-ovn
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/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-openstack-ovn-techpreview
/test e2e-vsphere-capi-techpreview
/test regression-clusterinfra-aws-ipi-techpreview-capi

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 10, 2026

[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 Mar 10, 2026
@damdo
Copy link
Member

damdo commented Mar 10, 2026

/pipeline required

@openshift-ci-robot
Copy link

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-capi-techpreview
/test e2e-aws-ovn
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/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-openstack-ovn-techpreview
/test e2e-vsphere-capi-techpreview
/test regression-clusterinfra-aws-ipi-techpreview-capi

@sunzhaohua2
Copy link
Contributor Author

/retest

1 similar comment
@damdo
Copy link
Member

damdo commented Mar 11, 2026

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 11, 2026

@sunzhaohua2: 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-openstack-capi-techpreview 69fbffb link true /test e2e-openstack-capi-techpreview
ci/prow/e2e-openstack-ovn-techpreview 69fbffb link true /test e2e-openstack-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants