Skip to content

Commit

Permalink
Fix getVMManagementTypeByIPConfigurationID()
Browse files Browse the repository at this point in the history
Force cache refresh for getVMManagementTypeByIPConfigurationID().
The reason is that when a new standalone VM is included in the cluster,
CCM cannot tell its VM type with stale cache.

Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
  • Loading branch information
lzhecheng committed Apr 18, 2024
1 parent 86cfc44 commit ed80312
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/provider/azure_vmss.go
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromNode(nodeName string, backendPoo

// GetNodeNameByIPConfigurationID gets the node name and the VMSS name by IP configuration ID.
func (ss *ScaleSet) GetNodeNameByIPConfigurationID(ipConfigurationID string) (string, string, error) {
vmManagementType, err := ss.getVMManagementTypeByIPConfigurationID(ipConfigurationID, azcache.CacheReadTypeUnsafe)
vmManagementType, err := ss.getVMManagementTypeByIPConfigurationID(ipConfigurationID, azcache.CacheReadTypeForceRefresh)
if err != nil {
klog.Errorf("Failed to check VM management type: %v", err)
return "", "", err
Expand Down Expand Up @@ -1915,7 +1915,7 @@ func (ss *ScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolIDs
continue
}

vmManagementType, err := ss.getVMManagementTypeByIPConfigurationID(*ipConf.ID, azcache.CacheReadTypeUnsafe)
vmManagementType, err := ss.getVMManagementTypeByIPConfigurationID(*ipConf.ID, azcache.CacheReadTypeForceRefresh)
if err != nil {
klog.Warningf("Failed to check VM management type by ipConfigurationID %s: %v, skip it", *ipConf.ID, err)
}
Expand Down

0 comments on commit ed80312

Please sign in to comment.