4
4
"context"
5
5
"fmt"
6
6
7
+ "github.com/go-logr/logr"
7
8
. "github.com/onsi/ginkgo/v2"
8
9
v1 "k8s.io/api/apps/v1"
9
10
apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
@@ -12,7 +13,6 @@ import (
12
13
"k8s.io/apimachinery/pkg/types"
13
14
"sigs.k8s.io/controller-runtime/pkg/client"
14
15
"sigs.k8s.io/controller-runtime/pkg/client/fake"
15
- "sigs.k8s.io/controller-runtime/pkg/log/zap"
16
16
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
17
17
18
18
. "github.com/onsi/gomega"
@@ -60,7 +60,7 @@ var _ = Describe("handler", func() {
60
60
return fakeTime
61
61
}
62
62
63
- statusUpdater = status .NewUpdater (k8sclient , zap . New ())
63
+ statusUpdater = status .NewUpdater (k8sclient , logr . Discard ())
64
64
65
65
// Add GatewayClass CRD to the cluster
66
66
crd = & metav1.PartialObjectMetadata {
@@ -114,7 +114,7 @@ var _ = Describe("handler", func() {
114
114
Resource : crd ,
115
115
},
116
116
}
117
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
117
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
118
118
119
119
// Ensure GatewayClass is accepted
120
120
@@ -152,7 +152,7 @@ var _ = Describe("handler", func() {
152
152
},
153
153
}
154
154
155
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
155
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
156
156
157
157
depNsName := types.NamespacedName {
158
158
Namespace : "nginx-gateway" ,
@@ -187,7 +187,7 @@ var _ = Describe("handler", func() {
187
187
},
188
188
}
189
189
190
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
190
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
191
191
192
192
updatedGC := & gatewayv1.GatewayClass {}
193
193
@@ -249,7 +249,7 @@ var _ = Describe("handler", func() {
249
249
}
250
250
251
251
handle := func () {
252
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
252
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
253
253
}
254
254
255
255
Expect (handle ).Should (Panic ())
@@ -310,7 +310,7 @@ var _ = Describe("handler", func() {
310
310
},
311
311
}
312
312
313
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
313
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
314
314
deps := & v1.DeploymentList {}
315
315
316
316
err := k8sclient .List (context .Background (), deps )
@@ -330,7 +330,7 @@ var _ = Describe("handler", func() {
330
330
},
331
331
}
332
332
333
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
333
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
334
334
335
335
deps := & v1.DeploymentList {}
336
336
@@ -359,7 +359,7 @@ var _ = Describe("handler", func() {
359
359
},
360
360
}
361
361
362
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
362
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
363
363
364
364
deps := & v1.DeploymentList {}
365
365
err := k8sclient .List (context .Background (), deps )
@@ -392,7 +392,7 @@ var _ = Describe("handler", func() {
392
392
},
393
393
}
394
394
395
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
395
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
396
396
397
397
unknownGC := & gatewayv1.GatewayClass {}
398
398
err = k8sclient .Get (context .Background (), client .ObjectKeyFromObject (newGC ), unknownGC )
@@ -456,7 +456,7 @@ var _ = Describe("handler", func() {
456
456
batch := []interface {}{e }
457
457
458
458
handle := func () {
459
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
459
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
460
460
}
461
461
462
462
Expect (handle ).Should (Panic ())
@@ -524,7 +524,7 @@ var _ = Describe("handler", func() {
524
524
}
525
525
526
526
handle := func () {
527
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
527
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
528
528
}
529
529
530
530
Expect (handle ).Should (Panic ())
@@ -545,7 +545,7 @@ var _ = Describe("handler", func() {
545
545
}
546
546
547
547
handle := func () {
548
- handler .HandleEventBatch (context .Background (), zap . New (), batch )
548
+ handler .HandleEventBatch (context .Background (), logr . Discard (), batch )
549
549
}
550
550
551
551
Expect (handle ).Should (Panic ())
0 commit comments