mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-08 16:30:57 -04:00
Merge pull request #131579 from ndbaker1/automated-cherry-pick-of-#131251-origin-release-1.31
Automated cherry pick of #131251: fix(kubelet): acquire imageRecordsLock when removing image
This commit is contained in:
commit
e561c4c2a2
1 changed files with 3 additions and 0 deletions
|
|
@ -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 a new issue