Skip to content

Commit 6a88ad1

Browse files
committed
Moved index function into its own variable for readability
1 parent 08763f8 commit 6a88ad1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/cache/cache_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,10 @@ var _ = Describe("Informer Cache", func() {
274274

275275
By("indexing the restartPolicy field of the Pod object before starting")
276276
pod := &kcorev1.Pod{}
277-
Expect(informer.IndexField(pod, "spec.restartPolicy", func(obj runtime.Object) []string {
277+
indexFunc := func(obj runtime.Object) []string {
278278
return []string{string(obj.(*kcorev1.Pod).Spec.RestartPolicy)}
279-
})).ToNot(HaveOccurred())
279+
}
280+
Expect(informer.IndexField(pod, "spec.restartPolicy", indexFunc)).ToNot(HaveOccurred())
280281

281282
By("running the cache and waiting for it to sync")
282283
go func() {

0 commit comments

Comments
 (0)