Skip to content

Commit

Permalink
Account for regular cache and multinamespaced cache in List GVK test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSpeed committed Apr 3, 2019
1 parent 0de9031 commit bab2dad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca

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

By("verifying that the returned pods have GVK populated")
Expect(listObj.Items).NotTo(BeEmpty())
Expect(listObj.Items).Should(HaveLen(3))
for _, p := range listObj.Items {
Expect(out.Items).NotTo(BeEmpty())
Expect(out.Items).Should(SatisfyAny(HaveLen(3), HaveLen(4)))
for _, p := range out.Items {
Expect(p.GroupVersionKind()).To(Equal(kcorev1.SchemeGroupVersion.WithKind("Pod")))
}
})
Expand Down

0 comments on commit bab2dad

Please sign in to comment.