File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
cluster-autoscaler/cloudprovider/gce Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,16 @@ func (gc *GceCache) InvalidateAllMigInstances() {
244
244
gc .instancesUpdateTime = make (map [GceRef ]time.Time )
245
245
}
246
246
247
+ // InvalidateMigInstances clears the mig instances cache for a given Mig
248
+ func (gc * GceCache ) InvalidateMigInstances (migRef GceRef ) {
249
+ gc .cacheMutex .Lock ()
250
+ defer gc .cacheMutex .Unlock ()
251
+
252
+ klog .V (5 ).Infof ("Mig instances cache invalidated for %v" , migRef .Name )
253
+ delete (gc .instances , migRef )
254
+ delete (gc .instancesUpdateTime , migRef )
255
+ }
256
+
247
257
// InvalidateInstancesToMig clears the instance to mig mapping for a GceRef
248
258
func (gc * GceCache ) InvalidateInstancesToMig (migRef GceRef ) {
249
259
gc .cacheMutex .Lock ()
Original file line number Diff line number Diff line change @@ -277,6 +277,7 @@ func (m *gceManagerImpl) DeleteInstances(instances []GceRef) error {
277
277
}
278
278
}
279
279
m .cache .InvalidateMigTargetSize (commonMig .GceRef ())
280
+ m .cache .InvalidateMigInstances (commonMig .GceRef ())
280
281
return m .GceService .DeleteInstances (commonMig .GceRef (), instances )
281
282
}
282
283
You can’t perform that action at this time.
0 commit comments