44 "context"
55 "fmt"
66
7+ "github.com/go-logr/logr"
78 . "github.com/onsi/ginkgo/v2"
89 v1 "k8s.io/api/apps/v1"
910 apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
@@ -12,7 +13,6 @@ import (
1213 "k8s.io/apimachinery/pkg/types"
1314 "sigs.k8s.io/controller-runtime/pkg/client"
1415 "sigs.k8s.io/controller-runtime/pkg/client/fake"
15- "sigs.k8s.io/controller-runtime/pkg/log/zap"
1616 gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
1717
1818 . "github.com/onsi/gomega"
@@ -60,7 +60,7 @@ var _ = Describe("handler", func() {
6060 return fakeTime
6161 }
6262
63- statusUpdater = status .NewUpdater (k8sclient , zap . New ())
63+ statusUpdater = status .NewUpdater (k8sclient , logr . Discard ())
6464
6565 // Add GatewayClass CRD to the cluster
6666 crd = & metav1.PartialObjectMetadata {
@@ -114,7 +114,7 @@ var _ = Describe("handler", func() {
114114 Resource : crd ,
115115 },
116116 }
117- handler .HandleEventBatch (context .Background (), zap . New (), batch )
117+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
118118
119119 // Ensure GatewayClass is accepted
120120
@@ -152,7 +152,7 @@ var _ = Describe("handler", func() {
152152 },
153153 }
154154
155- handler .HandleEventBatch (context .Background (), zap . New (), batch )
155+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
156156
157157 depNsName := types.NamespacedName {
158158 Namespace : "nginx-gateway" ,
@@ -187,7 +187,7 @@ var _ = Describe("handler", func() {
187187 },
188188 }
189189
190- handler .HandleEventBatch (context .Background (), zap . New (), batch )
190+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
191191
192192 updatedGC := & gatewayv1.GatewayClass {}
193193
@@ -249,7 +249,7 @@ var _ = Describe("handler", func() {
249249 }
250250
251251 handle := func () {
252- handler .HandleEventBatch (context .Background (), zap . New (), batch )
252+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
253253 }
254254
255255 Expect (handle ).Should (Panic ())
@@ -310,7 +310,7 @@ var _ = Describe("handler", func() {
310310 },
311311 }
312312
313- handler .HandleEventBatch (context .Background (), zap . New (), batch )
313+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
314314 deps := & v1.DeploymentList {}
315315
316316 err := k8sclient .List (context .Background (), deps )
@@ -330,7 +330,7 @@ var _ = Describe("handler", func() {
330330 },
331331 }
332332
333- handler .HandleEventBatch (context .Background (), zap . New (), batch )
333+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
334334
335335 deps := & v1.DeploymentList {}
336336
@@ -359,7 +359,7 @@ var _ = Describe("handler", func() {
359359 },
360360 }
361361
362- handler .HandleEventBatch (context .Background (), zap . New (), batch )
362+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
363363
364364 deps := & v1.DeploymentList {}
365365 err := k8sclient .List (context .Background (), deps )
@@ -392,7 +392,7 @@ var _ = Describe("handler", func() {
392392 },
393393 }
394394
395- handler .HandleEventBatch (context .Background (), zap . New (), batch )
395+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
396396
397397 unknownGC := & gatewayv1.GatewayClass {}
398398 err = k8sclient .Get (context .Background (), client .ObjectKeyFromObject (newGC ), unknownGC )
@@ -456,7 +456,7 @@ var _ = Describe("handler", func() {
456456 batch := []interface {}{e }
457457
458458 handle := func () {
459- handler .HandleEventBatch (context .Background (), zap . New (), batch )
459+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
460460 }
461461
462462 Expect (handle ).Should (Panic ())
@@ -524,7 +524,7 @@ var _ = Describe("handler", func() {
524524 }
525525
526526 handle := func () {
527- handler .HandleEventBatch (context .Background (), zap . New (), batch )
527+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
528528 }
529529
530530 Expect (handle ).Should (Panic ())
@@ -545,7 +545,7 @@ var _ = Describe("handler", func() {
545545 }
546546
547547 handle := func () {
548- handler .HandleEventBatch (context .Background (), zap . New (), batch )
548+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
549549 }
550550
551551 Expect (handle ).Should (Panic ())
0 commit comments