@@ -62,11 +62,12 @@ import (
62
62
messagingv1beta1kafkachannelreconciler "knative.dev/eventing-kafka-broker/control-plane/pkg/client/injection/reconciler/messaging/v1beta1/kafkachannel"
63
63
64
64
"github.com/rickb777/date/period"
65
+ eventingrekttesting "knative.dev/eventing/pkg/reconciler/testing/v1"
66
+ reconcilertesting "knative.dev/eventing/pkg/reconciler/testing/v1"
67
+
65
68
internalscg "knative.dev/eventing-kafka-broker/control-plane/pkg/apis/internals/kafka/eventing/v1alpha1"
66
69
kafkainternals "knative.dev/eventing-kafka-broker/control-plane/pkg/apis/internals/kafka/eventing/v1alpha1"
67
70
fakeconsumergroupinformer "knative.dev/eventing-kafka-broker/control-plane/pkg/client/internals/kafka/injection/client/fake"
68
- eventingrekttesting "knative.dev/eventing/pkg/reconciler/testing/v1"
69
- reconcilertesting "knative.dev/eventing/pkg/reconciler/testing/v1"
70
71
)
71
72
72
73
const (
@@ -478,6 +479,7 @@ func TestReconcileKind(t *testing.T) {
478
479
ConsumerSubscriber (NewConsumerSpecSubscriber (Subscription1URI )),
479
480
ConsumerReply (ConsumerUrlReply (apis .HTTP (Subscription1ReplyURI ))),
480
481
)),
482
+ withChannelTopLevelResourceRef (),
481
483
),
482
484
},
483
485
WantUpdates : []clientgotesting.UpdateActionImpl {
@@ -551,6 +553,7 @@ func TestReconcileKind(t *testing.T) {
551
553
ConsumerSubscriber (NewConsumerSpecSubscriber (Subscription1URI )),
552
554
ConsumerReply (ConsumerUrlReply (apis .HTTP (Subscription1ReplyURI ))),
553
555
)),
556
+ withChannelTopLevelResourceRef (),
554
557
),
555
558
},
556
559
WantUpdates : []clientgotesting.UpdateActionImpl {
@@ -625,6 +628,7 @@ func TestReconcileKind(t *testing.T) {
625
628
ConsumerSubscriber (NewConsumerSpecSubscriber (Subscription1URI )),
626
629
ConsumerReply (ConsumerUrlReply (apis .HTTP (Subscription1ReplyURI ))),
627
630
)),
631
+ withChannelTopLevelResourceRef (),
628
632
),
629
633
},
630
634
WantUpdates : []clientgotesting.UpdateActionImpl {
@@ -684,6 +688,7 @@ func TestReconcileKind(t *testing.T) {
684
688
WithConsumerGroupOwnerRef (kmeta .NewControllerRef (NewChannel ())),
685
689
WithConsumerGroupMetaLabels (OwnerAsChannelLabel ),
686
690
ConsumerGroupReady ,
691
+ withChannelTopLevelResourceRef (),
687
692
),
688
693
},
689
694
Key : testKey ,
@@ -725,6 +730,7 @@ func TestReconcileKind(t *testing.T) {
725
730
ConsumerReply (ConsumerUrlReply (apis .HTTP (Subscription1ReplyURI ))),
726
731
)),
727
732
ConsumerGroupReady ,
733
+ withChannelTopLevelResourceRef (),
728
734
),
729
735
},
730
736
},
@@ -779,6 +785,7 @@ func TestReconcileKind(t *testing.T) {
779
785
)),
780
786
ConsumerGroupReplicas (1 ),
781
787
WithConsumerGroupFailed ("failed to reconcile consumer group," , "internal error" ),
788
+ withChannelTopLevelResourceRef (),
782
789
),
783
790
},
784
791
Key : testKey ,
@@ -858,6 +865,7 @@ func TestReconcileKind(t *testing.T) {
858
865
ConsumerSubscriber (NewConsumerSpecSubscriber (Subscription1URI )),
859
866
ConsumerReply (ConsumerUrlReply (apis .HTTP (Subscription1ReplyURI ))),
860
867
)),
868
+ withChannelTopLevelResourceRef (),
861
869
),
862
870
NewConsumerGroup (
863
871
WithConsumerGroupName (Subscription2UUID ),
@@ -875,6 +883,7 @@ func TestReconcileKind(t *testing.T) {
875
883
ConsumerSubscriber (NewConsumerSpecSubscriber (Subscription2URI )),
876
884
ConsumerReply (ConsumerNoReply ()),
877
885
)),
886
+ withChannelTopLevelResourceRef (),
878
887
),
879
888
},
880
889
WantUpdates : []clientgotesting.UpdateActionImpl {
@@ -946,6 +955,7 @@ func TestReconcileKind(t *testing.T) {
946
955
ConsumerDelivery (NewConsumerSpecDelivery (kafkasource .Ordered )),
947
956
ConsumerSubscriber (NewConsumerSpecSubscriber (Subscription2URI )),
948
957
)),
958
+ withChannelTopLevelResourceRef (),
949
959
),
950
960
},
951
961
Key : testKey ,
@@ -967,6 +977,7 @@ func TestReconcileKind(t *testing.T) {
967
977
ConsumerSubscriber (NewConsumerSpecSubscriber (Subscription1URI )),
968
978
ConsumerReply (ConsumerUrlReply (apis .HTTP (Subscription1ReplyURI ))),
969
979
)),
980
+ withChannelTopLevelResourceRef (),
970
981
),
971
982
},
972
983
WantUpdates : []clientgotesting.UpdateActionImpl {
@@ -1218,6 +1229,7 @@ func TestReconcileKind(t *testing.T) {
1218
1229
)),
1219
1230
ConsumerGroupReplicas (1 ),
1220
1231
ConsumerGroupReady ,
1232
+ withChannelTopLevelResourceRef (),
1221
1233
),
1222
1234
},
1223
1235
Key : testKey ,
@@ -1324,6 +1336,7 @@ func TestReconcileKind(t *testing.T) {
1324
1336
)),
1325
1337
ConsumerGroupReplicas (1 ),
1326
1338
ConsumerGroupReady ,
1339
+ withChannelTopLevelResourceRef (),
1327
1340
),
1328
1341
},
1329
1342
Key : testKey ,
@@ -1429,6 +1442,7 @@ func TestReconcileKind(t *testing.T) {
1429
1442
)),
1430
1443
ConsumerGroupReplicas (1 ),
1431
1444
ConsumerGroupReady ,
1445
+ withChannelTopLevelResourceRef (),
1432
1446
),
1433
1447
},
1434
1448
Key : testKey ,
@@ -1528,6 +1542,7 @@ func TestReconcileKind(t *testing.T) {
1528
1542
ConsumerSubscriber (NewConsumerSpecSubscriber (Subscription1URI )),
1529
1543
ConsumerReply (ConsumerUrlReply (apis .HTTP (Subscription1ReplyURI ))),
1530
1544
)),
1545
+ withChannelTopLevelResourceRef (),
1531
1546
),
1532
1547
},
1533
1548
WantUpdates : []clientgotesting.UpdateActionImpl {
@@ -2430,3 +2445,13 @@ func httpsURL(name string, namespace string) *apis.URL {
2430
2445
Path : fmt .Sprintf ("/%s/%s" , namespace , name ),
2431
2446
}
2432
2447
}
2448
+
2449
+ func withChannelTopLevelResourceRef () ConsumerGroupOption {
2450
+ return WithTopLevelResourceRef (& corev1.ObjectReference {
2451
+ APIVersion : messagingv1beta .SchemeGroupVersion .String (),
2452
+ Kind : "KafkaChannel" ,
2453
+ Namespace : ChannelNamespace ,
2454
+ Name : ChannelName ,
2455
+ UID : ChannelUUID ,
2456
+ })
2457
+ }
0 commit comments