From 6eff2b5ccdbe8d42bb5e474fdaa690f7f8f92d0f Mon Sep 17 00:00:00 2001 From: Craig Condit Date: Mon, 23 Oct 2023 18:33:17 -0500 Subject: [PATCH] Share core logic between GetPod / GetPodNoLock --- pkg/cache/external/scheduler_cache.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/cache/external/scheduler_cache.go b/pkg/cache/external/scheduler_cache.go index 92647ddb1..aaf063f51 100644 --- a/pkg/cache/external/scheduler_cache.go +++ b/pkg/cache/external/scheduler_cache.go @@ -471,10 +471,7 @@ func (cache *SchedulerCache) removePod(pod *v1.Pod) { func (cache *SchedulerCache) GetPod(uid string) (*v1.Pod, bool) { cache.lock.RLock() defer cache.lock.RUnlock() - if pod, ok := cache.podsMap[uid]; ok { - return pod, true - } - return nil, false + return cache.GetPodNoLock(uid) } func (cache *SchedulerCache) GetPodNoLock(uid string) (*v1.Pod, bool) {