Skip to content

Commit

Permalink
Merge pull request #5821 from andyzhangx/fix-get-zone-panic
Browse files Browse the repository at this point in the history
fix: get zone panic
  • Loading branch information
k8s-ci-robot authored Apr 1, 2024
2 parents f570bd1 + eca4c5c commit 15fadde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/provider/azure_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ func (az *Cloud) GetZone(_ context.Context) (cloudprovider.Zone, error) {
if err != nil {
return cloudprovider.Zone{}, fmt.Errorf("failure getting hostname from kernel")
}
if az.VMSet == nil {
return cloudprovider.Zone{}, fmt.Errorf("VMSet is not initialized")
}
return az.VMSet.GetZoneByNodeName(strings.ToLower(hostname))
}

Expand Down

0 comments on commit 15fadde

Please # to comment.