From 76fb6f54e66b3eacc0b690af291d23617c7c8e16 Mon Sep 17 00:00:00 2001 From: Kashif Khan Date: Wed, 20 Mar 2024 09:13:03 +0200 Subject: [PATCH] Get Machine using controlplane labels instead of names 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 --- test/e2e/common.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/common.go b/test/e2e/common.go index 76f7b1ecb5..dbc9db8c6a 100644 --- a/test/e2e/common.go +++ b/test/e2e/common.go @@ -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) } }