Skip to content

Commit a1dd84a

Browse files
authored
Merge pull request #1263 from stackhpc/fix/optional-az
🐛 Make failure domain optional for OpenStackMachine
2 parents 217844f + 1096dab commit a1dd84a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

controllers/openstackmachine_controller.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,6 @@ func machineToInstanceSpec(openStackCluster *infrav1.OpenStackCluster, machine *
421421
return nil, fmt.Errorf("create Options need be specified to create instace")
422422
}
423423

424-
if machine.Spec.FailureDomain == nil {
425-
return nil, fmt.Errorf("failure domain not set")
426-
}
427-
428424
instanceSpec := compute.InstanceSpec{
429425
Name: openStackMachine.Name,
430426
Image: openStackMachine.Spec.Image,
@@ -434,13 +430,17 @@ func machineToInstanceSpec(openStackCluster *infrav1.OpenStackCluster, machine *
434430
UserData: userData,
435431
Metadata: openStackMachine.Spec.ServerMetadata,
436432
ConfigDrive: openStackMachine.Spec.ConfigDrive != nil && *openStackMachine.Spec.ConfigDrive,
437-
FailureDomain: *machine.Spec.FailureDomain,
438433
RootVolume: openStackMachine.Spec.RootVolume,
439434
Subnet: openStackMachine.Spec.Subnet,
440435
ServerGroupID: openStackMachine.Spec.ServerGroupID,
441436
Trunk: openStackMachine.Spec.Trunk,
442437
}
443438

439+
// Add the failure domain only if specified
440+
if machine.Spec.FailureDomain != nil {
441+
instanceSpec.FailureDomain = *machine.Spec.FailureDomain
442+
}
443+
444444
machineTags := []string{}
445445

446446
// Append machine specific tags

0 commit comments

Comments
 (0)