Skip to content

Conversation

@huali9
Copy link
Contributor

@huali9 huali9 commented Jun 19, 2025

This is ready for review @sunzhaohua2 @miyadav @shellyyang1989 @JoelSpeed PTAL, thanks!

@openshift-ci openshift-ci bot requested review from nrb and racheljpg June 19, 2025 11:43
@huali9
Copy link
Contributor Author

huali9 commented Jun 19, 2025

/hold

@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 Jun 19, 2025
@huali9 huali9 force-pushed the machinemig branch 2 times, most recently from 4262eea to d046757 Compare June 20, 2025 10:21
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 4, 2025
@huali9 huali9 force-pushed the machinemig branch 3 times, most recently from 10a25e4 to 4e18a0c Compare July 15, 2025 11:07
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 15, 2025
@huali9 huali9 force-pushed the machinemig branch 2 times, most recently from 582d6fe to 9474904 Compare July 17, 2025 06:57
@huali9
Copy link
Contributor Author

huali9 commented Jul 17, 2025

creation and deletion cases passed in my local now, update and migration cases are blocked by bug https://issues.redhat.com/browse/OCPBUGS-54703

@nrb
Copy link
Contributor

nrb commented Jul 17, 2025

@huali9 Could you update the title on the PR? I assume this is e2es, but I'm not sure.

@huali9 huali9 changed the title Machinemigration OCPCLOUD-2992: machine migration e2e when authoritativeAPI is ClusterAPI Jul 18, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 18, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 18, 2025

@huali9: This pull request references OCPCLOUD-2992 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 story to target the "4.20.0" version, but no target version was set.

Details

In response to this:

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.

@huali9
Copy link
Contributor Author

huali9 commented Jul 18, 2025

/test ci/prow/unit

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 18, 2025

@huali9: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test build
/test e2e-aws-capi-customnoupgrade-migration
/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-upgrade
/test e2e-gcp-capi-techpreview
/test e2e-gcp-ovn-techpreview
/test e2e-openstack-capi-techpreview
/test e2e-openstack-ovn-techpreview
/test e2e-vsphere-capi-techpreview
/test images
/test lint
/test unit
/test vendor
/test verify-deps

The following commands are available to trigger optional jobs:

/test e2e-azure-ovn-techpreview
/test e2e-metal3-capi-techpreview
/test okd-scos-e2e-aws-ovn
/test okd-scos-images
/test regression-clusterinfra-aws-ipi-techpreview-capi
/test security

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-cluster-capi-operator-main-build
pull-ci-openshift-cluster-capi-operator-main-e2e-aws-capi-customnoupgrade-migration
pull-ci-openshift-cluster-capi-operator-main-e2e-aws-capi-techpreview
pull-ci-openshift-cluster-capi-operator-main-e2e-aws-ovn
pull-ci-openshift-cluster-capi-operator-main-e2e-aws-ovn-serial-1of2
pull-ci-openshift-cluster-capi-operator-main-e2e-aws-ovn-serial-2of2
pull-ci-openshift-cluster-capi-operator-main-e2e-aws-ovn-techpreview
pull-ci-openshift-cluster-capi-operator-main-e2e-aws-ovn-techpreview-upgrade
pull-ci-openshift-cluster-capi-operator-main-e2e-azure-capi-techpreview
pull-ci-openshift-cluster-capi-operator-main-e2e-azure-ovn-techpreview
pull-ci-openshift-cluster-capi-operator-main-e2e-azure-ovn-techpreview-upgrade
pull-ci-openshift-cluster-capi-operator-main-e2e-gcp-capi-techpreview
pull-ci-openshift-cluster-capi-operator-main-e2e-gcp-ovn-techpreview
pull-ci-openshift-cluster-capi-operator-main-e2e-metal3-capi-techpreview
pull-ci-openshift-cluster-capi-operator-main-e2e-openstack-capi-techpreview
pull-ci-openshift-cluster-capi-operator-main-e2e-openstack-ovn-techpreview
pull-ci-openshift-cluster-capi-operator-main-e2e-vsphere-capi-techpreview
pull-ci-openshift-cluster-capi-operator-main-images
pull-ci-openshift-cluster-capi-operator-main-lint
pull-ci-openshift-cluster-capi-operator-main-okd-scos-e2e-aws-ovn
pull-ci-openshift-cluster-capi-operator-main-regression-clusterinfra-aws-ipi-techpreview-capi
pull-ci-openshift-cluster-capi-operator-main-security
pull-ci-openshift-cluster-capi-operator-main-unit
pull-ci-openshift-cluster-capi-operator-main-vendor
pull-ci-openshift-cluster-capi-operator-main-verify-deps
Details

In response to this:

/test ci/prow/unit

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.

@huali9
Copy link
Contributor Author

huali9 commented Jul 18, 2025

/test unit

@huali9
Copy link
Contributor Author

huali9 commented Jul 18, 2025

/retest

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 21, 2025

@huali9: This pull request references OCPCLOUD-2992 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 story to target the "4.20.0" version, but no target version was set.

Details

In response to this:

This is ready for review @sunzhaohua2 @miyadav @shellyyang1989 @JoelSpeed PTAL, thanks!

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.

@huali9
Copy link
Contributor Author

huali9 commented Jul 21, 2025

/hold
still have some places which need update

@huali9 huali9 force-pushed the machinemig branch 3 times, most recently from 8c74e79 to 9231414 Compare July 24, 2025 06:44
@huali9 huali9 changed the title OCPCLOUD-2992: machine migration e2e when authoritativeAPI is ClusterAPI OCPCLOUD-2992: migration e2e for creating machine with authoritativeAPI ClusterAPI Jul 24, 2025
@huali9
Copy link
Contributor Author

huali9 commented Jul 24, 2025

/test unit

@huali9
Copy link
Contributor Author

huali9 commented Aug 4, 2025

/retest

@huali9
Copy link
Contributor Author

huali9 commented Aug 4, 2025

@damdo Could you please help review this pr? Thanks!

@huali9
Copy link
Contributor Author

huali9 commented Aug 5, 2025

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 5, 2025
@huali9
Copy link
Contributor Author

huali9 commented Aug 5, 2025

/test unit

1 similar comment
@huali9
Copy link
Contributor Author

huali9 commented Aug 5, 2025

/test unit

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.

Thanks a lot @huali9 for the PR!
Logic looks good, just a bunch of comments around naming/text for consistency with tests introduced in https://github.com/openshift/cluster-capi-operator/pull/330/files?diff=unified&w=0

Comment on lines 69 to 70
if err := cl.Get(context.Background(), key, machine); err != nil {
return nil, fmt.Errorf("error querying api for awsmachine object: %w", err)
}
Copy link
Member

Choose a reason for hiding this comment

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

Let's wrap this into an eventually like below so we are more robust to transient/intermittent issues

}
})

var _ = Describe("Machine Creation", Ordered, func() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var _ = Describe("Machine Creation", Ordered, func() {
var _ = Describe("Create MAPI Machine", Ordered, func() {

To stay consistent with https://github.com/openshift/cluster-capi-operator/pull/330/files#diff-5ebecef9b3221104569dfaa6563ae90c684017b1197e77e6327bad5100371f97R41

})

var _ = Describe("Machine Creation", Ordered, func() {
var machineNameCAPI = "machine-auth-capi-creation"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var machineNameCAPI = "machine-auth-capi-creation"
var mapiMachineAuthCAPIName = "machine-authoritativeapi-capi"

To stay consistent with https://github.com/openshift/cluster-capi-operator/pull/330/files#diff-5ebecef9b3221104569dfaa6563ae90c684017b1197e77e6327bad5100371f97R43

var newMapiMachine *machinev1beta1.Machine
var err error

Context("when existing CAPI Machine with same name should allow creating the MAPI Machine with spec.authoritativeAPI: ClusterAPI", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Again for consistency with the MachineSet side of these tests, which already merged, I'd go with something like:

Suggested change
Context("when existing CAPI Machine with same name should allow creating the MAPI Machine with spec.authoritativeAPI: ClusterAPI", func() {
Context("with spec.authoritativeAPI: CAPI and already existing CAPI Machine with same name", func() {

newMachine.Status = machinev1beta1.MachineStatus{}
newMachine.Spec.AuthoritativeAPI = authority
By(fmt.Sprintf("Creating a new %s machine in namespace: %s", authority, newMachine.Namespace))
Expect(cl.Create(ctx, newMachine)).To(Succeed())
Copy link
Member

Choose a reason for hiding this comment

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

Let's change this to an Eventually().Should() and add an error message if the Should() fails, to make this more robust to transient issues.

})
})

Context("when no existing CAPI Machine with same name should allow creating the MAPI Machine with spec.authoritativeAPI: ClusterAPI", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Context("when no existing CAPI Machine with same name should allow creating the MAPI Machine with spec.authoritativeAPI: ClusterAPI", func() {
Context("with spec.authoritativeAPI: ClusterAPI and no existing CAPI Machine with same name", func() {

})
})

It("should verify CAPI Machine get Running", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
It("should verify CAPI Machine get Running", func() {
It("should verify CAPI Machine gets created and becomes Running", func() {

Comment on lines 178 to 179
// The test requires at least one existing MAPI machine to act as a template.
Expect(machineList).NotTo(BeEmpty(), "No MAPI machines found in the openshift-machine-api namespace to use as a template")
Copy link
Member

Choose a reason for hiding this comment

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

Template is already a "reserved" word in CAPI language.
We could use something like `to use as a reference for creating a new one".

Suggested change
// The test requires at least one existing MAPI machine to act as a template.
Expect(machineList).NotTo(BeEmpty(), "No MAPI machines found in the openshift-machine-api namespace to use as a template")
// The test requires at least one existing MAPI machine to act as a template.
Expect(machineList).NotTo(BeEmpty(), "No MAPI machines found in the openshift-machine-api namespace to use as a reference for creating a new one")

Comment on lines 181 to 196
// Select the first machine from the list as our template.
templateMachine := machineList[0]
By(fmt.Sprintf("Using MAPI machine %s as a template", templateMachine.Name))

// Define the new machine based on the template.
newMachine := &machinev1beta1.Machine{
ObjectMeta: metav1.ObjectMeta{
Name: machineName,
Namespace: templateMachine.Namespace,
},
Spec: *templateMachine.Spec.DeepCopy(),
}
Copy link
Member

Choose a reason for hiding this comment

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

Template is already a "reserved" word in CAPI language, let's use something similar to the suggestion in the above comment.

Comment on lines 117 to 133
capiMachineList, err := capiframework.GetMachines(cl)
Expect(err).NotTo(HaveOccurred(), "Failed to list CAPI machines")
// The test requires at least one existing CAPI machine to act as a template.
Expect(capiMachineList).NotTo(BeEmpty(), "No CAPI machines found in the openshift-cluster-api namespace to use as a template")

// Select the first machine from the list as our template.
templateCapiMachine := capiMachineList[0]
By(fmt.Sprintf("Using CAPI machine %s as a template", templateCapiMachine.Name))

// Define the new machine based on the template.
newCapiMachine := &clusterv1.Machine{
ObjectMeta: metav1.ObjectMeta{
Name: machineName,
Namespace: templateCapiMachine.Namespace,
},
Spec: *templateCapiMachine.Spec.DeepCopy(),
}
Copy link
Member

Choose a reason for hiding this comment

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

Template is already a "reserved" word in CAPI language, let's use something similar to the suggestion in the above comment.

@huali9 huali9 force-pushed the machinemig branch 2 times, most recently from 13c46a1 to ac422eb Compare August 7, 2025 03:25
@huali9
Copy link
Contributor Author

huali9 commented Aug 7, 2025

Thanks a lot @damdo for the detailed review. I have updated, PTAL again, thanks!

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

Thanks @huali9 !

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 7, 2025

[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 Aug 7, 2025
@huali9
Copy link
Contributor Author

huali9 commented Aug 7, 2025

/test e2e-gcp-ovn-techpreview

@damdo
Copy link
Member

damdo commented Aug 7, 2025

This PR only adds E2Es that don't run in [ci/prow/e2e-gcp-ovn-techpreview]

/override ci/prow/e2e-gcp-ovn-techpreview

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 7, 2025

@damdo: Overrode contexts on behalf of damdo: ci/prow/e2e-gcp-ovn-techpreview

Details

In response to this:

This PR only adds E2Es that don't run in [ci/prow/e2e-gcp-ovn-techpreview]

/override ci/prow/e2e-gcp-ovn-techpreview

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.

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 35f6be0 and 2 for PR HEAD de4b49c in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 35f6be0 and 2 for PR HEAD de4b49c in total

@damdo
Copy link
Member

damdo commented Aug 7, 2025

This PR only adds E2Es that don't run in [ci/prow/e2e-gcp-ovn-techpreview]

/override ci/prow/e2e-gcp-ovn-techpreview

@damdo
Copy link
Member

damdo commented Aug 7, 2025

Same for ci/prow/e2e-openstack-ovn-techpreview

/override ci/prow/e2e-openstack-ovn-techpreview

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 7, 2025

@damdo: Overrode contexts on behalf of damdo: ci/prow/e2e-gcp-ovn-techpreview

Details

In response to this:

This PR only adds E2Es that don't run in [ci/prow/e2e-gcp-ovn-techpreview]

/override ci/prow/e2e-gcp-ovn-techpreview

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 7, 2025

@damdo: Overrode contexts on behalf of damdo: ci/prow/e2e-openstack-ovn-techpreview

Details

In response to this:

Same for ci/prow/e2e-openstack-ovn-techpreview

/override ci/prow/e2e-openstack-ovn-techpreview

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.

@openshift-merge-bot openshift-merge-bot bot merged commit e02143b into openshift:main Aug 7, 2025
26 of 27 checks passed
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 7, 2025

@huali9: The following test 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/okd-scos-e2e-aws-ovn de4b49c link false /test okd-scos-e2e-aws-ovn

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.

@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-capi-operator
This PR has been included in build ose-cluster-capi-operator-container-v4.20.0-202508072056.p0.ge02143b.assembly.stream.el9.
All builds following this will include this PR.

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.

7 participants