@@ -61,10 +61,10 @@ import (
61
61
kedaclient "knative.dev/eventing-kafka-broker/third_party/pkg/client/injection/client/fake"
62
62
)
63
63
64
- type SchedulerFunc func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error )
64
+ type SchedulerFunc func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error )
65
65
66
- func (f SchedulerFunc ) Schedule (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
67
- return f (vpod )
66
+ func (f SchedulerFunc ) Schedule (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
67
+ return f (ctx , vpod )
68
68
}
69
69
70
70
const (
@@ -102,7 +102,7 @@ func TestReconcileKind(t *testing.T) {
102
102
},
103
103
Key : ConsumerGroupTestKey ,
104
104
OtherTestData : map [string ]interface {}{
105
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
105
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
106
106
return []eventingduckv1alpha1.Placement {
107
107
{PodName : "p1" , VReplicas : 1 },
108
108
{PodName : "p2" , VReplicas : 1 },
@@ -189,7 +189,7 @@ func TestReconcileKind(t *testing.T) {
189
189
},
190
190
Key : ConsumerGroupTestKey ,
191
191
OtherTestData : map [string ]interface {}{
192
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
192
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
193
193
return []eventingduckv1alpha1.Placement {
194
194
{PodName : "p1" , VReplicas : 1 },
195
195
{PodName : "p2" , VReplicas : 1 },
@@ -307,7 +307,7 @@ func TestReconcileKind(t *testing.T) {
307
307
},
308
308
Key : ConsumerGroupTestKey ,
309
309
OtherTestData : map [string ]interface {}{
310
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
310
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
311
311
return []eventingduckv1alpha1.Placement {
312
312
{PodName : "p1" , VReplicas : 1 },
313
313
{PodName : "p2" , VReplicas : 1 },
@@ -402,7 +402,7 @@ func TestReconcileKind(t *testing.T) {
402
402
},
403
403
Key : ConsumerGroupTestKey ,
404
404
OtherTestData : map [string ]interface {}{
405
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
405
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
406
406
return []eventingduckv1alpha1.Placement {
407
407
{PodName : "p1" , VReplicas : 1 },
408
408
{PodName : "p2" , VReplicas : 1 },
@@ -528,7 +528,7 @@ func TestReconcileKind(t *testing.T) {
528
528
},
529
529
Key : ConsumerGroupTestKey ,
530
530
OtherTestData : map [string ]interface {}{
531
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
531
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
532
532
return []eventingduckv1alpha1.Placement {
533
533
{PodName : "p1" , VReplicas : 1 },
534
534
{PodName : "p2" , VReplicas : 1 },
@@ -702,7 +702,7 @@ func TestReconcileKind(t *testing.T) {
702
702
},
703
703
Key : ConsumerGroupTestKey ,
704
704
OtherTestData : map [string ]interface {}{
705
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
705
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
706
706
return []eventingduckv1alpha1.Placement {
707
707
{PodName : "p1" , VReplicas : 1 },
708
708
{PodName : "p2" , VReplicas : 1 },
@@ -877,7 +877,7 @@ func TestReconcileKind(t *testing.T) {
877
877
},
878
878
Key : ConsumerGroupTestKey ,
879
879
OtherTestData : map [string ]interface {}{
880
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
880
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
881
881
return []eventingduckv1alpha1.Placement {
882
882
{PodName : "p1" , VReplicas : 1 },
883
883
{PodName : "p2" , VReplicas : 1 },
@@ -1034,7 +1034,7 @@ func TestReconcileKind(t *testing.T) {
1034
1034
},
1035
1035
Key : ConsumerGroupTestKey ,
1036
1036
OtherTestData : map [string ]interface {}{
1037
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1037
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1038
1038
return []eventingduckv1alpha1.Placement {
1039
1039
{PodName : "p1" , VReplicas : 1 },
1040
1040
}, nil
@@ -1121,7 +1121,7 @@ func TestReconcileKind(t *testing.T) {
1121
1121
},
1122
1122
Key : ConsumerGroupTestKey ,
1123
1123
OtherTestData : map [string ]interface {}{
1124
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1124
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1125
1125
return []eventingduckv1alpha1.Placement {
1126
1126
{PodName : "p1" , VReplicas : 1 },
1127
1127
{PodName : "p2" , VReplicas : 1 },
@@ -1208,7 +1208,7 @@ func TestReconcileKind(t *testing.T) {
1208
1208
},
1209
1209
Key : ConsumerGroupTestKey ,
1210
1210
OtherTestData : map [string ]interface {}{
1211
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1211
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1212
1212
return []eventingduckv1alpha1.Placement {
1213
1213
{PodName : "p1" , VReplicas : 1 },
1214
1214
{PodName : "p2" , VReplicas : 1 },
@@ -1303,7 +1303,7 @@ func TestReconcileKind(t *testing.T) {
1303
1303
},
1304
1304
Key : ConsumerGroupTestKey ,
1305
1305
OtherTestData : map [string ]interface {}{
1306
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1306
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1307
1307
return []eventingduckv1alpha1.Placement {
1308
1308
{PodName : "p1" , VReplicas : 1 },
1309
1309
{PodName : "p2" , VReplicas : 2 },
@@ -1426,7 +1426,7 @@ func TestReconcileKind(t *testing.T) {
1426
1426
},
1427
1427
Key : ConsumerGroupTestKey ,
1428
1428
OtherTestData : map [string ]interface {}{
1429
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1429
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1430
1430
return []eventingduckv1alpha1.Placement {
1431
1431
{PodName : "p1" , VReplicas : 1 },
1432
1432
{PodName : "p2" , VReplicas : 2 },
@@ -1533,7 +1533,7 @@ func TestReconcileKind(t *testing.T) {
1533
1533
},
1534
1534
Key : ConsumerGroupTestKey ,
1535
1535
OtherTestData : map [string ]interface {}{
1536
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1536
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1537
1537
return []eventingduckv1alpha1.Placement {
1538
1538
{PodName : "p1" , VReplicas : 1 },
1539
1539
{PodName : "p2" , VReplicas : 1 },
@@ -1630,7 +1630,7 @@ func TestReconcileKind(t *testing.T) {
1630
1630
},
1631
1631
Key : ConsumerGroupTestKey ,
1632
1632
OtherTestData : map [string ]interface {}{
1633
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1633
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1634
1634
return nil , io .EOF
1635
1635
}),
1636
1636
},
@@ -1762,7 +1762,7 @@ func TestReconcileKindNoAutoscaler(t *testing.T) {
1762
1762
},
1763
1763
Key : ConsumerGroupTestKey ,
1764
1764
OtherTestData : map [string ]interface {}{
1765
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1765
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1766
1766
return []eventingduckv1alpha1.Placement {
1767
1767
{PodName : "p1" , VReplicas : 1 },
1768
1768
{PodName : "p2" , VReplicas : 1 },
@@ -1926,7 +1926,7 @@ func TestFinalizeKind(t *testing.T) {
1926
1926
},
1927
1927
Key : testKey ,
1928
1928
OtherTestData : map [string ]interface {}{
1929
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1929
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1930
1930
return nil , nil
1931
1931
}),
1932
1932
},
@@ -1995,7 +1995,7 @@ func TestFinalizeKind(t *testing.T) {
1995
1995
},
1996
1996
Key : testKey ,
1997
1997
OtherTestData : map [string ]interface {}{
1998
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1998
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1999
1999
return nil , nil
2000
2000
}),
2001
2001
},
@@ -2121,7 +2121,7 @@ func TestFinalizeKind(t *testing.T) {
2121
2121
},
2122
2122
Key : testKey ,
2123
2123
OtherTestData : map [string ]interface {}{
2124
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2124
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2125
2125
return nil , nil
2126
2126
}),
2127
2127
},
@@ -2167,7 +2167,7 @@ func TestFinalizeKind(t *testing.T) {
2167
2167
},
2168
2168
Key : testKey ,
2169
2169
OtherTestData : map [string ]interface {}{
2170
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2170
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2171
2171
return nil , nil
2172
2172
}),
2173
2173
kafkatesting .ErrorOnDeleteConsumerGroupTestKey : sarama .ErrUnknownTopicOrPartition ,
@@ -2214,7 +2214,7 @@ func TestFinalizeKind(t *testing.T) {
2214
2214
},
2215
2215
Key : testKey ,
2216
2216
OtherTestData : map [string ]interface {}{
2217
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2217
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2218
2218
return nil , nil
2219
2219
}),
2220
2220
kafkatesting .ErrorOnDeleteConsumerGroupTestKey : sarama .ErrGroupIDNotFound ,
@@ -2262,7 +2262,7 @@ func TestFinalizeKind(t *testing.T) {
2262
2262
WantErr : true ,
2263
2263
Key : testKey ,
2264
2264
OtherTestData : map [string ]interface {}{
2265
- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2265
+ testSchedulerKey : SchedulerFunc (func (_ context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2266
2266
return nil , nil
2267
2267
}),
2268
2268
kafkatesting .ErrorOnDeleteConsumerGroupTestKey : sarama .ErrClusterAuthorizationFailed ,
0 commit comments