Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/framework/machineset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 11 additions & 1 deletion e2e/machine_migration_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
1 change: 0 additions & 1 deletion e2e/machineset_migration_mapi_authoritative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions pkg/util/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down