@@ -20,11 +20,16 @@ import (
20
20
"context"
21
21
22
22
"k8s.io/client-go/tools/cache"
23
+ "knative.dev/pkg/configmap"
24
+ "knative.dev/pkg/controller"
25
+ "knative.dev/pkg/logging"
26
+
27
+ "knative.dev/eventing/pkg/apis/feature"
23
28
v1 "knative.dev/eventing/pkg/apis/flows/v1"
24
29
"knative.dev/eventing/pkg/auth"
25
30
"knative.dev/eventing/pkg/duck"
26
- "knative.dev/pkg/configmap"
27
- "knative.dev/pkg/controller "
31
+
32
+ "knative.dev/pkg/injection/clients/dynamicclient "
28
33
29
34
flowsv1 "knative.dev/eventing/pkg/apis/flows/v1"
30
35
eventingclient "knative.dev/eventing/pkg/client/injection/client"
@@ -33,7 +38,6 @@ import (
33
38
"knative.dev/eventing/pkg/client/injection/informers/flows/v1/sequence"
34
39
"knative.dev/eventing/pkg/client/injection/informers/messaging/v1/subscription"
35
40
sequencereconciler "knative.dev/eventing/pkg/client/injection/reconciler/flows/v1/sequence"
36
- "knative.dev/pkg/injection/clients/dynamicclient"
37
41
)
38
42
39
43
// NewController initializes the controller and is called by the generated code
@@ -47,14 +51,30 @@ func NewController(
47
51
subscriptionInformer := subscription .Get (ctx )
48
52
eventPolicyInformer := eventpolicy .Get (ctx )
49
53
54
+ var globalResync func ()
55
+ store := feature .NewStore (logging .FromContext (ctx ), func (name string , value interface {}) {
56
+ if globalResync != nil {
57
+ globalResync ()
58
+ }
59
+ })
60
+ store .WatchConfigs (cmw )
61
+
50
62
r := & Reconciler {
51
63
sequenceLister : sequenceInformer .Lister (),
52
64
subscriptionLister : subscriptionInformer .Lister (),
53
65
dynamicClientSet : dynamicclient .Get (ctx ),
54
66
eventingClientSet : eventingclient .Get (ctx ),
55
67
eventPolicyLister : eventPolicyInformer .Lister (),
56
68
}
57
- impl := sequencereconciler .NewImpl (ctx , r )
69
+ impl := sequencereconciler .NewImpl (ctx , r , func (impl * controller.Impl ) controller.Options {
70
+ return controller.Options {
71
+ ConfigStore : store ,
72
+ }
73
+ })
74
+
75
+ globalResync = func () {
76
+ impl .GlobalResync (sequenceInformer .Informer ())
77
+ }
58
78
59
79
r .channelableTracker = duck .NewListableTrackerFromTracker (ctx , channelable .Get , impl .Tracker )
60
80
sequenceInformer .Informer ().AddEventHandler (controller .HandleAll (impl .Enqueue ))
0 commit comments