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