@@ -113,7 +113,7 @@ var _ = Describe("Informer Cache", func() {
113113 It ("should be able to list objects that haven't been watched previously" , func () {
114114 By ("listing all services in the cluster" )
115115 listObj := & kcorev1.ServiceList {}
116- Expect (informerCache .List (context .Background (), listObj )).To (Succeed ())
116+ Expect (informerCache .List (context .Background (), nil , listObj )).To (Succeed ())
117117
118118 By ("verifying that the returned list contains the Kubernetes service" )
119119 // NB: kubernetes default service is automatically created in testenv.
@@ -143,10 +143,8 @@ var _ = Describe("Informer Cache", func() {
143143 By ("listing pods with a particular label" )
144144 // NB: each pod has a "test-label": <pod-name>
145145 out := kcorev1.PodList {}
146- Expect (informerCache .List (context .Background (), & out ,
147- client .InNamespace (testNamespaceTwo ),
148- client .MatchingLabels (map [string ]string {"test-label" : "test-pod-2" }),
149- )).To (Succeed ())
146+ Expect (informerCache .List (context .Background (), client .InNamespace (testNamespaceTwo ).
147+ MatchingLabels (map [string ]string {"test-label" : "test-pod-2" }), & out )).To (Succeed ())
150148
151149 By ("verifying the returned pods have the correct label" )
152150 Expect (out .Items ).NotTo (BeEmpty ())
@@ -163,9 +161,8 @@ var _ = Describe("Informer Cache", func() {
163161 // NB: each pod has a "test-label": <pod-name>
164162 out := kcorev1.PodList {}
165163 labels := map [string ]string {"test-label" : "test-pod-2" }
166- Expect (informerCache .List (context .Background (), & out ,
167- client .MatchingLabels (labels ),
168- )).To (Succeed ())
164+ Expect (informerCache .List (context .Background (),
165+ client .MatchingLabels (labels ), & out )).To (Succeed ())
169166
170167 By ("verifying multiple pods with the same label in different namespaces are returned" )
171168 Expect (out .Items ).NotTo (BeEmpty ())
@@ -180,9 +177,9 @@ var _ = Describe("Informer Cache", func() {
180177 It ("should be able to list objects by namespace" , func () {
181178 By ("listing pods in test-namespace-1" )
182179 listObj := & kcorev1.PodList {}
183- Expect (informerCache .List (context .Background (), listObj ,
180+ Expect (informerCache .List (context .Background (),
184181 client .InNamespace (testNamespaceOne ),
185- )).To (Succeed ())
182+ listObj )).To (Succeed ())
186183
187184 By ("verifying that the returned pods are in test-namespace-1" )
188185 Expect (listObj .Items ).NotTo (BeEmpty ())
@@ -320,9 +317,9 @@ var _ = Describe("Informer Cache", func() {
320317
321318 By ("listing Pods with restartPolicyOnFailure" )
322319 listObj := & kcorev1.PodList {}
323- Expect (informer .List (context .Background (), listObj ,
320+ Expect (informer .List (context .Background (),
324321 client .MatchingField ("spec.restartPolicy" , "OnFailure" ),
325- )).To (Succeed ())
322+ listObj )).To (Succeed ())
326323
327324 By ("verifying that the returned pods have correct restart policy" )
328325 Expect (listObj .Items ).NotTo (BeEmpty ())
0 commit comments