mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
cacher: Use PodList type for use in GetList
Using a Pod type in a GetList() call in a test can panic at worst and error out at best. Here, neither happened because the error condition being tested for (cacher being stopped or not) gets returned before the list pointer can be enforced. This commit changes the above to use PodList. Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
This commit is contained in:
parent
be53d94595
commit
487761f4e2
@ -647,10 +647,11 @@ func TestCacheDontAcceptRequestsStopped(t *testing.T) {
|
||||
t.Fatalf("Success to create Get: %v", err)
|
||||
}
|
||||
|
||||
listResult := &example.PodList{}
|
||||
err = cacher.GetList(context.TODO(), "pods/ns", storage.ListOptions{
|
||||
ResourceVersion: "1",
|
||||
Recursive: true,
|
||||
}, result)
|
||||
}, listResult)
|
||||
if err == nil {
|
||||
t.Fatalf("Success to create GetList: %v", err)
|
||||
}
|
||||
@ -660,7 +661,6 @@ func TestCacheDontAcceptRequestsStopped(t *testing.T) {
|
||||
case <-time.After(wait.ForeverTestTimeout):
|
||||
t.Errorf("timed out waiting for watch to close")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestTimeBucketWatchersBasic(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user