@@ -113,7 +113,7 @@ var _ = Describe("Informer Cache", func() {
113
113
It ("should be able to list objects that haven't been watched previously" , func () {
114
114
By ("listing all services in the cluster" )
115
115
listObj := & kcorev1.ServiceList {}
116
- Expect (informerCache .List (context .Background (), listObj )).To (Succeed ())
116
+ Expect (informerCache .List (context .Background (), nil , listObj )).To (Succeed ())
117
117
118
118
By ("verifying that the returned list contains the Kubernetes service" )
119
119
// NB: kubernetes default service is automatically created in testenv.
@@ -143,10 +143,8 @@ var _ = Describe("Informer Cache", func() {
143
143
By ("listing pods with a particular label" )
144
144
// NB: each pod has a "test-label": <pod-name>
145
145
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 ())
150
148
151
149
By ("verifying the returned pods have the correct label" )
152
150
Expect (out .Items ).NotTo (BeEmpty ())
@@ -163,9 +161,8 @@ var _ = Describe("Informer Cache", func() {
163
161
// NB: each pod has a "test-label": <pod-name>
164
162
out := kcorev1.PodList {}
165
163
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 ())
169
166
170
167
By ("verifying multiple pods with the same label in different namespaces are returned" )
171
168
Expect (out .Items ).NotTo (BeEmpty ())
@@ -180,9 +177,9 @@ var _ = Describe("Informer Cache", func() {
180
177
It ("should be able to list objects by namespace" , func () {
181
178
By ("listing pods in test-namespace-1" )
182
179
listObj := & kcorev1.PodList {}
183
- Expect (informerCache .List (context .Background (), listObj ,
180
+ Expect (informerCache .List (context .Background (),
184
181
client .InNamespace (testNamespaceOne ),
185
- )).To (Succeed ())
182
+ listObj )).To (Succeed ())
186
183
187
184
By ("verifying that the returned pods are in test-namespace-1" )
188
185
Expect (listObj .Items ).NotTo (BeEmpty ())
@@ -320,9 +317,9 @@ var _ = Describe("Informer Cache", func() {
320
317
321
318
By ("listing Pods with restartPolicyOnFailure" )
322
319
listObj := & kcorev1.PodList {}
323
- Expect (informer .List (context .Background (), listObj ,
320
+ Expect (informer .List (context .Background (),
324
321
client .MatchingField ("spec.restartPolicy" , "OnFailure" ),
325
- )).To (Succeed ())
322
+ listObj )).To (Succeed ())
326
323
327
324
By ("verifying that the returned pods have correct restart policy" )
328
325
Expect (listObj .Items ).NotTo (BeEmpty ())
0 commit comments