@@ -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 (), nil , listObj )).To (Succeed ())
116
+ Expect (informerCache .List (context .Background (), 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,8 +143,10 @@ 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 (), client .InNamespace (testNamespaceTwo ).
147
- MatchingLabels (map [string ]string {"test-label" : "test-pod-2" }), & out )).To (Succeed ())
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 ())
148
150
149
151
By ("verifying the returned pods have the correct label" )
150
152
Expect (out .Items ).NotTo (BeEmpty ())
@@ -161,8 +163,9 @@ var _ = Describe("Informer Cache", func() {
161
163
// NB: each pod has a "test-label": <pod-name>
162
164
out := kcorev1.PodList {}
163
165
labels := map [string ]string {"test-label" : "test-pod-2" }
164
- Expect (informerCache .List (context .Background (),
165
- client .MatchingLabels (labels ), & out )).To (Succeed ())
166
+ Expect (informerCache .List (context .Background (), & out ,
167
+ client .MatchingLabels (labels ),
168
+ )).To (Succeed ())
166
169
167
170
By ("verifying multiple pods with the same label in different namespaces are returned" )
168
171
Expect (out .Items ).NotTo (BeEmpty ())
@@ -177,9 +180,9 @@ var _ = Describe("Informer Cache", func() {
177
180
It ("should be able to list objects by namespace" , func () {
178
181
By ("listing pods in test-namespace-1" )
179
182
listObj := & kcorev1.PodList {}
180
- Expect (informerCache .List (context .Background (),
183
+ Expect (informerCache .List (context .Background (), listObj ,
181
184
client .InNamespace (testNamespaceOne ),
182
- listObj )).To (Succeed ())
185
+ )).To (Succeed ())
183
186
184
187
By ("verifying that the returned pods are in test-namespace-1" )
185
188
Expect (listObj .Items ).NotTo (BeEmpty ())
@@ -317,9 +320,9 @@ var _ = Describe("Informer Cache", func() {
317
320
318
321
By ("listing Pods with restartPolicyOnFailure" )
319
322
listObj := & kcorev1.PodList {}
320
- Expect (informer .List (context .Background (),
323
+ Expect (informer .List (context .Background (), listObj ,
321
324
client .MatchingField ("spec.restartPolicy" , "OnFailure" ),
322
- listObj )).To (Succeed ())
325
+ )).To (Succeed ())
323
326
324
327
By ("verifying that the returned pods have correct restart policy" )
325
328
Expect (listObj .Items ).NotTo (BeEmpty ())
0 commit comments