Skip to content

Commit

Permalink
Get Machine using controlplane labels instead of names
Browse files Browse the repository at this point in the history
Starting from v1.7 metal3machines will inherit machine name and wont have strings like controlplane and worker in their names anymore.

Signed-off-by: Kashif Khan <[email protected]>
  • Loading branch information
kashifest committed Mar 20, 2024
1 parent 025867b commit 76fb6f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,10 @@ func GetMetal3Machines(ctx context.Context, c client.Client, _, namespace string
Expect(c.List(ctx, allMachines, client.InNamespace(namespace))).To(Succeed())

for _, machine := range allMachines.Items {
if strings.Contains(machine.ObjectMeta.Name, "workers") {
workers = append(workers, machine)
} else {
if _, ok := machine.GetLabels()[clusterv1.MachineControlPlaneLabel]; ok {
controlplane = append(controlplane, machine)
} else {
workers = append(workers, machine)
}
}

Expand Down

0 comments on commit 76fb6f5

Please sign in to comment.