@@ -20,11 +20,16 @@ import (
2020 "context"
2121
2222 "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"
2328 v1 "knative.dev/eventing/pkg/apis/flows/v1"
2429 "knative.dev/eventing/pkg/auth"
2530 "knative.dev/eventing/pkg/duck"
26- "knative.dev/pkg/configmap"
27- "knative.dev/pkg/controller "
31+
32+ "knative.dev/pkg/injection/clients/dynamicclient "
2833
2934 flowsv1 "knative.dev/eventing/pkg/apis/flows/v1"
3035 eventingclient "knative.dev/eventing/pkg/client/injection/client"
@@ -33,7 +38,6 @@ import (
3338 "knative.dev/eventing/pkg/client/injection/informers/flows/v1/sequence"
3439 "knative.dev/eventing/pkg/client/injection/informers/messaging/v1/subscription"
3540 sequencereconciler "knative.dev/eventing/pkg/client/injection/reconciler/flows/v1/sequence"
36- "knative.dev/pkg/injection/clients/dynamicclient"
3741)
3842
3943// NewController initializes the controller and is called by the generated code
@@ -47,14 +51,30 @@ func NewController(
4751 subscriptionInformer := subscription .Get (ctx )
4852 eventPolicyInformer := eventpolicy .Get (ctx )
4953
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+
5062 r := & Reconciler {
5163 sequenceLister : sequenceInformer .Lister (),
5264 subscriptionLister : subscriptionInformer .Lister (),
5365 dynamicClientSet : dynamicclient .Get (ctx ),
5466 eventingClientSet : eventingclient .Get (ctx ),
5567 eventPolicyLister : eventPolicyInformer .Lister (),
5668 }
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+ }
5878
5979 r .channelableTracker = duck .NewListableTrackerFromTracker (ctx , channelable .Get , impl .Tracker )
6080 sequenceInformer .Informer ().AddEventHandler (controller .HandleAll (impl .Enqueue ))
0 commit comments