Skip to content

Commit 8f8b3f5

Browse files
committed
Account for regular cache and multinamespaced cache in List GVK test
1 parent 88f5187 commit 8f8b3f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/cache/cache_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
200200

201201
It("should be able to list objects with GVK populated", func() {
202202
By("listing pods")
203-
listObj := &kcorev1.PodList{}
204-
Expect(informerCache.List(context.Background(), listObj)).To(Succeed())
203+
out := &kcorev1.PodList{}
204+
Expect(informerCache.List(context.Background(), out)).To(Succeed())
205205

206206
By("verifying that the returned pods have GVK populated")
207-
Expect(listObj.Items).NotTo(BeEmpty())
208-
Expect(listObj.Items).Should(HaveLen(3))
209-
for _, p := range listObj.Items {
207+
Expect(out.Items).NotTo(BeEmpty())
208+
Expect(out.Items).Should(SatisfyAny(HaveLen(3), HaveLen(4)))
209+
for _, p := range out.Items {
210210
Expect(p.GroupVersionKind()).To(Equal(kcorev1.SchemeGroupVersion.WithKind("Pod")))
211211
}
212212
})

0 commit comments

Comments
 (0)