Skip to content

Commit

Permalink
UPSTREAM: 124541: Return from EnsureHostInPool on all NIC errors
Browse files Browse the repository at this point in the history
When looking up the NIC, if there's an error, this function should
return regardless of the error.

The previous code could proceed when an instance wasn't found, and the
`nic` would be a nil pointer.

Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com>
  • Loading branch information
nrb committed May 7, 2024
1 parent 6c10b2d commit 2dc4df0
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -823,9 +823,7 @@ func (as *availabilitySet) EnsureHostInPool(service *v1.Service, nodeName types.
}

klog.Errorf("error: az.EnsureHostInPool(%s), az.VMSet.GetPrimaryInterface.Get(%s, %s), err=%v", nodeName, vmName, vmSetName, err)
if err != cloudprovider.InstanceNotFound {
return "", "", "", nil, err
}
return "", "", "", nil, err
}

if nic.ProvisioningState != nil && *nic.ProvisioningState == nicFailedState {
Expand Down

0 comments on commit 2dc4df0

Please sign in to comment.