mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 20:00:07 +00:00
fix(kubelet): acquire imageRecordsLock when removing image
This commit is contained in:
@@ -521,7 +521,10 @@ func (im *realImageGCManager) freeImage(ctx context.Context, image evictionInfo,
|
||||
if isRuntimeClassInImageCriAPIEnabled {
|
||||
imageKey = getImageTuple(image.id, image.runtimeHandlerUsedToPullImage)
|
||||
}
|
||||
|
||||
im.imageRecordsLock.Lock()
|
||||
delete(im.imageRecords, imageKey)
|
||||
im.imageRecordsLock.Unlock()
|
||||
|
||||
metrics.ImageGarbageCollectedTotal.WithLabelValues(reason).Inc()
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user