Skip to content

Commit 53134e4

Browse files
committed
fix: set machine fd string if not defined
This commit sets the `machine.Spec.FailureDomain` string from the `vsphereMachine.Spec.FailureDomain` if defined and the machine failure domain is empty. This resolves an issue where virtual machines are not placed within vm-host groups in a timely manner causing misplacement in the topology.
1 parent 3cf591f commit 53134e4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

controllers/vspherevm_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ func (r vmReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.R
233233
return ctrl.Result{}, err
234234
}
235235

236+
if vsphereMachine.Spec.FailureDomain != nil && *vsphereMachine.Spec.FailureDomain != "" {
237+
if machine.Spec.FailureDomain == "" {
238+
machine.Spec.FailureDomain = *vsphereMachine.Spec.FailureDomain
239+
}
240+
}
241+
236242
var vsphereFailureDomain *infrav1.VSphereFailureDomain
237243
if failureDomain := machine.Spec.FailureDomain; failureDomain != "" {
238244
vsphereDeploymentZone := &infrav1.VSphereDeploymentZone{}

0 commit comments

Comments
 (0)