Skip to content

Commit

Permalink
Fix the bug that nicName in the if block shadows the counterpart outs…
Browse files Browse the repository at this point in the history
…ide.
  • Loading branch information
nilo19 committed Aug 23, 2020
1 parent a86950d commit 8352911
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cluster-autoscaler/cloudprovider/azure/azure_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,12 @@ func (util *AzUtil) DeleteVirtualMachine(rg string, name string) error {

osDiskName := vm.VirtualMachineProperties.StorageProfile.OsDisk.Name
var nicName string
var err error
nicID := (*vm.VirtualMachineProperties.NetworkProfile.NetworkInterfaces)[0].ID
if nicID == nil {
klog.Warningf("NIC ID is not set for VM (%s/%s)", rg, name)
} else {
nicName, err := resourceName(*nicID)
nicName, err = resourceName(*nicID)
if err != nil {
return err
}
Expand Down

0 comments on commit 8352911

Please sign in to comment.