diff --git a/e2e/framework/machineset.go b/e2e/framework/machineset.go index bfc0249c0..c51b5bf93 100644 --- a/e2e/framework/machineset.go +++ b/e2e/framework/machineset.go @@ -136,7 +136,7 @@ func DeleteMachineSets(ctx context.Context, cl client.Client, machineSets ...*cl // MachineSet to enter the "Running" phase, and for all nodes belonging to those // Machines to be ready. func WaitForMachineSet(cl client.Client, name string, namespace string) { - By(fmt.Sprintf("Waiting for MachineSet machines %q to enter Running phase", name)) + By(fmt.Sprintf("Waiting for CAPI MachineSet machines %q to enter Running phase", name)) machineSet := GetMachineSet(cl, name, namespace) diff --git a/e2e/machine_migration_helpers.go b/e2e/machine_migration_helpers.go index 8626d9745..2ca1835af 100644 --- a/e2e/machine_migration_helpers.go +++ b/e2e/machine_migration_helpers.go @@ -23,7 +23,17 @@ import ( func createCAPIMachine(ctx context.Context, cl client.Client, machineName string) *clusterv1beta1.Machine { Expect(machineName).NotTo(BeEmpty(), "Machine name cannot be empty") - capiMachineList := capiframework.GetMachines(cl) + + workerLabelSelector := metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{ + { + Key: clusterv1beta1.MachineControlPlaneLabel, + Operator: metav1.LabelSelectorOpDoesNotExist, + }, + }, + } + + capiMachineList := capiframework.GetMachines(cl, &workerLabelSelector) // The test requires at least one existing CAPI machine to act as a reference for creating a new one. Expect(capiMachineList).NotTo(BeEmpty(), "Should have found CAPI machines in the openshift-cluster-api namespace to use as a reference for creating a new one") diff --git a/e2e/machineset_migration_mapi_authoritative_test.go b/e2e/machineset_migration_mapi_authoritative_test.go index d1a464a1d..2128e8b11 100644 --- a/e2e/machineset_migration_mapi_authoritative_test.go +++ b/e2e/machineset_migration_mapi_authoritative_test.go @@ -195,7 +195,6 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Ma It("should succeed scaling down CAPI MachineSet to 1, after the switch of AuthoritativeAPI to ClusterAPI", func() { By("Scaling down CAPI MachineSet to 1") capiframework.ScaleCAPIMachineSet(mapiMSAuthMAPIName, 1, capiframework.CAPINamespace) - capiframework.WaitForMachineSet(cl, mapiMSAuthMAPIName, capiframework.CAPINamespace) By("Verifying both CAPI MachineSet and its MAPI MachineSet mirror are scaled down to 1") verifyMachinesetReplicas(capiMachineSet, 1) diff --git a/pkg/util/sync.go b/pkg/util/sync.go index 410c178ad..b3dbeade9 100644 --- a/pkg/util/sync.go +++ b/pkg/util/sync.go @@ -206,6 +206,10 @@ func CAPIMachineStatusEqual(a, b clusterv1beta1.MachineStatus) map[string]any { diff[".nodeInfo"] = diffNodeInfo } + if diffNodeRef := deep.Equal(a.NodeRef, b.NodeRef); len(diffNodeRef) > 0 { + diff[".nodeRef"] = diffNodeRef + } + if diffConditions := compareCAPIV1Beta1Conditions(a.Conditions, b.Conditions); len(diffConditions) > 0 { diff[".conditions"] = diffConditions }