mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
fix(kubelet): acquire imageRecordsLock when removing image
This commit is contained in:
parent
d5df907c3c
commit
22e84c9abf
@ -494,7 +494,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
|
||||
|
Loading…
Reference in New Issue
Block a user