@@ -61,12 +61,6 @@ import (
6161 kedaclient "knative.dev/eventing-kafka-broker/third_party/pkg/client/injection/client/fake"
6262)
6363
64- type SchedulerFunc func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error )
65-
66- func (f SchedulerFunc ) Schedule (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
67- return f (vpod )
68- }
69-
7064const (
7165 testSchedulerKey = "scheduler"
7266 noTestScheduler = "no-scheduler"
@@ -102,7 +96,7 @@ func TestReconcileKind(t *testing.T) {
10296 },
10397 Key : ConsumerGroupTestKey ,
10498 OtherTestData : map [string ]interface {}{
105- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
99+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
106100 return []eventingduckv1alpha1.Placement {
107101 {PodName : "p1" , VReplicas : 1 },
108102 {PodName : "p2" , VReplicas : 1 },
@@ -189,7 +183,7 @@ func TestReconcileKind(t *testing.T) {
189183 },
190184 Key : ConsumerGroupTestKey ,
191185 OtherTestData : map [string ]interface {}{
192- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
186+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
193187 return []eventingduckv1alpha1.Placement {
194188 {PodName : "p1" , VReplicas : 1 },
195189 {PodName : "p2" , VReplicas : 1 },
@@ -307,7 +301,7 @@ func TestReconcileKind(t *testing.T) {
307301 },
308302 Key : ConsumerGroupTestKey ,
309303 OtherTestData : map [string ]interface {}{
310- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
304+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
311305 return []eventingduckv1alpha1.Placement {
312306 {PodName : "p1" , VReplicas : 1 },
313307 {PodName : "p2" , VReplicas : 1 },
@@ -402,7 +396,7 @@ func TestReconcileKind(t *testing.T) {
402396 },
403397 Key : ConsumerGroupTestKey ,
404398 OtherTestData : map [string ]interface {}{
405- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
399+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
406400 return []eventingduckv1alpha1.Placement {
407401 {PodName : "p1" , VReplicas : 1 },
408402 {PodName : "p2" , VReplicas : 1 },
@@ -528,7 +522,7 @@ func TestReconcileKind(t *testing.T) {
528522 },
529523 Key : ConsumerGroupTestKey ,
530524 OtherTestData : map [string ]interface {}{
531- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
525+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
532526 return []eventingduckv1alpha1.Placement {
533527 {PodName : "p1" , VReplicas : 1 },
534528 {PodName : "p2" , VReplicas : 1 },
@@ -702,7 +696,7 @@ func TestReconcileKind(t *testing.T) {
702696 },
703697 Key : ConsumerGroupTestKey ,
704698 OtherTestData : map [string ]interface {}{
705- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
699+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
706700 return []eventingduckv1alpha1.Placement {
707701 {PodName : "p1" , VReplicas : 1 },
708702 {PodName : "p2" , VReplicas : 1 },
@@ -877,7 +871,7 @@ func TestReconcileKind(t *testing.T) {
877871 },
878872 Key : ConsumerGroupTestKey ,
879873 OtherTestData : map [string ]interface {}{
880- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
874+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
881875 return []eventingduckv1alpha1.Placement {
882876 {PodName : "p1" , VReplicas : 1 },
883877 {PodName : "p2" , VReplicas : 1 },
@@ -1034,7 +1028,7 @@ func TestReconcileKind(t *testing.T) {
10341028 },
10351029 Key : ConsumerGroupTestKey ,
10361030 OtherTestData : map [string ]interface {}{
1037- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1031+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
10381032 return []eventingduckv1alpha1.Placement {
10391033 {PodName : "p1" , VReplicas : 1 },
10401034 }, nil
@@ -1121,7 +1115,7 @@ func TestReconcileKind(t *testing.T) {
11211115 },
11221116 Key : ConsumerGroupTestKey ,
11231117 OtherTestData : map [string ]interface {}{
1124- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1118+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
11251119 return []eventingduckv1alpha1.Placement {
11261120 {PodName : "p1" , VReplicas : 1 },
11271121 {PodName : "p2" , VReplicas : 1 },
@@ -1208,7 +1202,7 @@ func TestReconcileKind(t *testing.T) {
12081202 },
12091203 Key : ConsumerGroupTestKey ,
12101204 OtherTestData : map [string ]interface {}{
1211- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1205+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
12121206 return []eventingduckv1alpha1.Placement {
12131207 {PodName : "p1" , VReplicas : 1 },
12141208 {PodName : "p2" , VReplicas : 1 },
@@ -1303,7 +1297,7 @@ func TestReconcileKind(t *testing.T) {
13031297 },
13041298 Key : ConsumerGroupTestKey ,
13051299 OtherTestData : map [string ]interface {}{
1306- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1300+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
13071301 return []eventingduckv1alpha1.Placement {
13081302 {PodName : "p1" , VReplicas : 1 },
13091303 {PodName : "p2" , VReplicas : 2 },
@@ -1426,7 +1420,7 @@ func TestReconcileKind(t *testing.T) {
14261420 },
14271421 Key : ConsumerGroupTestKey ,
14281422 OtherTestData : map [string ]interface {}{
1429- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1423+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
14301424 return []eventingduckv1alpha1.Placement {
14311425 {PodName : "p1" , VReplicas : 1 },
14321426 {PodName : "p2" , VReplicas : 2 },
@@ -1533,7 +1527,7 @@ func TestReconcileKind(t *testing.T) {
15331527 },
15341528 Key : ConsumerGroupTestKey ,
15351529 OtherTestData : map [string ]interface {}{
1536- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1530+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
15371531 return []eventingduckv1alpha1.Placement {
15381532 {PodName : "p1" , VReplicas : 1 },
15391533 {PodName : "p2" , VReplicas : 1 },
@@ -1630,7 +1624,7 @@ func TestReconcileKind(t *testing.T) {
16301624 },
16311625 Key : ConsumerGroupTestKey ,
16321626 OtherTestData : map [string ]interface {}{
1633- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1627+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
16341628 return nil , io .EOF
16351629 }),
16361630 },
@@ -1762,7 +1756,7 @@ func TestReconcileKindNoAutoscaler(t *testing.T) {
17621756 },
17631757 Key : ConsumerGroupTestKey ,
17641758 OtherTestData : map [string ]interface {}{
1765- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1759+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
17661760 return []eventingduckv1alpha1.Placement {
17671761 {PodName : "p1" , VReplicas : 1 },
17681762 {PodName : "p2" , VReplicas : 1 },
@@ -1926,7 +1920,7 @@ func TestFinalizeKind(t *testing.T) {
19261920 },
19271921 Key : testKey ,
19281922 OtherTestData : map [string ]interface {}{
1929- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1923+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
19301924 return nil , nil
19311925 }),
19321926 },
@@ -1995,7 +1989,7 @@ func TestFinalizeKind(t *testing.T) {
19951989 },
19961990 Key : testKey ,
19971991 OtherTestData : map [string ]interface {}{
1998- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
1992+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
19991993 return nil , nil
20001994 }),
20011995 },
@@ -2121,7 +2115,7 @@ func TestFinalizeKind(t *testing.T) {
21212115 },
21222116 Key : testKey ,
21232117 OtherTestData : map [string ]interface {}{
2124- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2118+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
21252119 return nil , nil
21262120 }),
21272121 },
@@ -2167,7 +2161,7 @@ func TestFinalizeKind(t *testing.T) {
21672161 },
21682162 Key : testKey ,
21692163 OtherTestData : map [string ]interface {}{
2170- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2164+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
21712165 return nil , nil
21722166 }),
21732167 kafkatesting .ErrorOnDeleteConsumerGroupTestKey : sarama .ErrUnknownTopicOrPartition ,
@@ -2214,7 +2208,7 @@ func TestFinalizeKind(t *testing.T) {
22142208 },
22152209 Key : testKey ,
22162210 OtherTestData : map [string ]interface {}{
2217- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2211+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
22182212 return nil , nil
22192213 }),
22202214 kafkatesting .ErrorOnDeleteConsumerGroupTestKey : sarama .ErrGroupIDNotFound ,
@@ -2262,7 +2256,7 @@ func TestFinalizeKind(t *testing.T) {
22622256 WantErr : true ,
22632257 Key : testKey ,
22642258 OtherTestData : map [string ]interface {}{
2265- testSchedulerKey : SchedulerFunc (func (vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
2259+ testSchedulerKey : scheduler . SchedulerFunc (func (ctx context. Context , vpod scheduler.VPod ) ([]eventingduckv1alpha1.Placement , error ) {
22662260 return nil , nil
22672261 }),
22682262 kafkatesting .ErrorOnDeleteConsumerGroupTestKey : sarama .ErrClusterAuthorizationFailed ,
0 commit comments