From b948bac45a1ed85dcc93bdb4d6be5fc5118c1154 Mon Sep 17 00:00:00 2001 From: Archangel_SDY Date: Wed, 1 Jul 2020 12:07:14 +0800 Subject: [PATCH] Fix a condition when expiring nil VM entry in VMSS cache --- .../src/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go index c0acb72c8f0d..94a85aade66e 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go +++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go @@ -182,7 +182,7 @@ func (ss *scaleSet) newVMSSVirtualMachinesCache() (*azcache.TimedCache, error) { for name, vmEntry := range oldCache { // if the nil cache entry has existed for 15 minutes in the cache // then it should not be added back to the cache - if vmEntry.virtualMachine == nil || time.Since(vmEntry.lastUpdate) > 15*time.Minute { + if vmEntry.virtualMachine == nil && time.Since(vmEntry.lastUpdate) > 15*time.Minute { klog.V(5).Infof("ignoring expired entries from old cache for %s", name) continue }