mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #105185 from ialidzhikov/fix/azure-lb-deletion
Ignore VMs in vmss delete backend pools
This commit is contained in:
commit
26365faf31
@ -1596,7 +1596,7 @@ func (ss *scaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID,
|
|||||||
|
|
||||||
hostUpdates := make([]func() error, 0, len(ipConfigurationIDs))
|
hostUpdates := make([]func() error, 0, len(ipConfigurationIDs))
|
||||||
nodeUpdates := make(map[vmssMetaInfo]map[string]compute.VirtualMachineScaleSetVM)
|
nodeUpdates := make(map[vmssMetaInfo]map[string]compute.VirtualMachineScaleSetVM)
|
||||||
errors := make([]error, 0)
|
allErrs := make([]error, 0)
|
||||||
for i := range ipConfigurationIDs {
|
for i := range ipConfigurationIDs {
|
||||||
ipConfigurationID := ipConfigurationIDs[i]
|
ipConfigurationID := ipConfigurationIDs[i]
|
||||||
|
|
||||||
@ -1616,14 +1616,16 @@ func (ss *scaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
klog.Errorf("Failed to GetNodeNameByIPConfigurationID(%s): %v", ipConfigurationID, err)
|
klog.Errorf("Failed to GetNodeNameByIPConfigurationID(%s): %v", ipConfigurationID, err)
|
||||||
errors = append(errors, err)
|
allErrs = append(allErrs, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeResourceGroup, nodeVMSS, nodeInstanceID, nodeVMSSVM, err := ss.ensureBackendPoolDeletedFromNode(nodeName, backendPoolID)
|
nodeResourceGroup, nodeVMSS, nodeInstanceID, nodeVMSSVM, err := ss.ensureBackendPoolDeletedFromNode(nodeName, backendPoolID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf("EnsureBackendPoolDeleted(%s): backendPoolID(%s) - failed with error %v", getServiceName(service), backendPoolID, err)
|
if !errors.Is(err, ErrorNotVmssInstance) { // Do nothing for the VMAS nodes.
|
||||||
errors = append(errors, err)
|
klog.Errorf("EnsureBackendPoolDeleted(%s): backendPoolID(%s) - failed with error %v", getServiceName(service), backendPoolID, err)
|
||||||
|
allErrs = append(allErrs, err)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1669,8 +1671,8 @@ func (ss *scaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fail if there are other errors.
|
// Fail if there are other errors.
|
||||||
if len(errors) > 0 {
|
if len(allErrs) > 0 {
|
||||||
return utilerrors.Flatten(utilerrors.NewAggregate(errors))
|
return utilerrors.Flatten(utilerrors.NewAggregate(allErrs))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the backendPoolID is also deleted on VMSS itself.
|
// Ensure the backendPoolID is also deleted on VMSS itself.
|
||||||
|
Loading…
Reference in New Issue
Block a user