Skip to content

Commit 87609a7

Browse files
committed
vmgroup: fixes membership and zone label key
1 parent 4443979 commit 87609a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

controllers/vmware/virtualmachinegroup_reconciler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ func getCurrentVSphereMachines(ctx context.Context, kubeClient client.Client, cl
385385
if err := kubeClient.List(ctx, &vsMachineList,
386386
client.InNamespace(clusterNamespace),
387387
client.MatchingLabels{clusterv1.ClusterNameLabel: clusterName},
388+
client.HasLabels{clusterv1.MachineDeploymentNameLabel},
388389
); err != nil {
389390
return nil, errors.Wrapf(err, "failed to list VSphereMachines in namespace %s", clusterNamespace)
390391
}
@@ -440,7 +441,7 @@ func GenerateVMGPlacementLabels(ctx context.Context, vmg *vmoprv1.VirtualMachine
440441
}
441442

442443
log.Info(fmt.Sprintf("VM %s in VMG %s/%s has been placed in zone %s", member.Name, vmg.Namespace, vmg.Name, zone))
443-
labels[md] = zone
444+
labels[fmt.Sprintf("zone.cluster.x-k8s.io/%s", md)] = zone
444445
}
445446
}
446447
}

0 commit comments

Comments
 (0)