Merge pull request #65412 from yastij/az-ignore-failed-nic

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

skip nic that are in failing state

**What this PR does / why we need it**: this fixes partially #65025. Currently when getting primary NIC for VMSS the provisioning state isn't returned.

**Which issue(s) this PR fixes** : Fixes partially (for VMAS) #65025

**Special notes for your reviewer**:

/assign @feiskyer 

**Release note**:

```release-note
skip nodes that have a primary NIC in a 'Failed' provisioningState
```
This commit is contained in:
Kubernetes Submit Queue 2018-07-01 20:25:04 -07:00 committed by GitHub
commit 36815869ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,8 @@ const (
InternalLoadBalancerNameSuffix = "-internal"
// nodeLabelRole specifies the role of a node
nodeLabelRole = "kubernetes.io/role"
nodeLabelRole = "kubernetes.io/role"
nicFailedState = "Failed"
storageAccountNameMaxLength = 24
)
@ -619,6 +620,11 @@ func (as *availabilitySet) ensureHostInPool(serviceName string, nodeName types.N
return err
}
if nic.ProvisioningState != nil && *nic.ProvisioningState == nicFailedState {
glog.V(3).Infof("ensureHostInPool skips node %s because its primdary nic %s is in Failed state", nodeName, nic.Name)
return nil
}
var primaryIPConfig *network.InterfaceIPConfiguration
primaryIPConfig, err = getPrimaryIPConfig(nic)
if err != nil {