Skip to content

Commit 8e579f3

Browse files
Merge pull request #141 from patrickdillon/ash-fault-domain-panic
OCPBUGS-51090: Fix panic for GetZoneByNodeName on Azure Stack
2 parents cc04736 + df298c5 commit 8e579f3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/provider/azure_standard.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,11 @@ func (as *availabilitySet) GetZoneByNodeName(ctx context.Context, name string) (
580580
failureDomain = as.makeZone(ptr.Deref(vm.Location, ""), zoneID)
581581
} else {
582582
// Availability zone is not used for the node, falling back to fault domain.
583-
failureDomain = strconv.Itoa(int(ptr.Deref(vm.Properties.InstanceView.PlatformFaultDomain, 0)))
583+
if prop := vm.Properties; prop == nil || prop.InstanceView == nil {
584+
failureDomain = "0"
585+
} else {
586+
failureDomain = strconv.Itoa(int(ptr.Deref(vm.Properties.InstanceView.PlatformFaultDomain, 0)))
587+
}
584588
}
585589

586590
zone := cloudprovider.Zone{

0 commit comments

Comments
 (0)