mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Remove direct accesses to cache's node map
Signed-off-by: Aldo Culquicondor <acondor@google.com> Change-Id: Iebb22fc816926aaa1ddd1e4b2e52f335a275ffaa Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
@@ -26,7 +26,6 @@ import (
|
||||
policy "k8s.io/api/policy/v1beta1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
cacheddiscovery "k8s.io/client-go/discovery/cached/memory"
|
||||
"k8s.io/client-go/dynamic"
|
||||
@@ -401,11 +400,11 @@ func waitForPDBsStable(testCtx *testutils.TestContext, pdbs []*policy.PodDisrupt
|
||||
// waitCachedPodsStable waits until scheduler cache has the given pods.
|
||||
func waitCachedPodsStable(testCtx *testutils.TestContext, pods []*v1.Pod) error {
|
||||
return wait.Poll(time.Second, 30*time.Second, func() (bool, error) {
|
||||
cachedPods, err := testCtx.Scheduler.SchedulerCache.ListPods(labels.Everything())
|
||||
cachedPods, err := testCtx.Scheduler.SchedulerCache.PodCount()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if len(pods) != len(cachedPods) {
|
||||
if len(pods) != cachedPods {
|
||||
return false, nil
|
||||
}
|
||||
for _, p := range pods {
|
||||
|
||||
Reference in New Issue
Block a user