@@ -421,10 +421,6 @@ func machineToInstanceSpec(openStackCluster *infrav1.OpenStackCluster, machine *
421
421
return nil , fmt .Errorf ("create Options need be specified to create instace" )
422
422
}
423
423
424
- if machine .Spec .FailureDomain == nil {
425
- return nil , fmt .Errorf ("failure domain not set" )
426
- }
427
-
428
424
instanceSpec := compute.InstanceSpec {
429
425
Name : openStackMachine .Name ,
430
426
Image : openStackMachine .Spec .Image ,
@@ -434,13 +430,17 @@ func machineToInstanceSpec(openStackCluster *infrav1.OpenStackCluster, machine *
434
430
UserData : userData ,
435
431
Metadata : openStackMachine .Spec .ServerMetadata ,
436
432
ConfigDrive : openStackMachine .Spec .ConfigDrive != nil && * openStackMachine .Spec .ConfigDrive ,
437
- FailureDomain : * machine .Spec .FailureDomain ,
438
433
RootVolume : openStackMachine .Spec .RootVolume ,
439
434
Subnet : openStackMachine .Spec .Subnet ,
440
435
ServerGroupID : openStackMachine .Spec .ServerGroupID ,
441
436
Trunk : openStackMachine .Spec .Trunk ,
442
437
}
443
438
439
+ // Add the failure domain only if specified
440
+ if machine .Spec .FailureDomain != nil {
441
+ instanceSpec .FailureDomain = * machine .Spec .FailureDomain
442
+ }
443
+
444
444
machineTags := []string {}
445
445
446
446
// Append machine specific tags
0 commit comments