mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30: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))
|
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]
|
||||||
|
|
||||||
@ -1601,14 +1601,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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1654,8 +1656,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