Skip to content

Commit

Permalink
fix: triggerv2 supports cg id templates
Browse files Browse the repository at this point in the history
Signed-off-by: Calum Murray <cmurray@redhat.com>
  • Loading branch information
Cali0707 committed Apr 3, 2024
1 parent d12c18f commit 8b07dc2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions control-plane/pkg/reconciler/trigger/v2/controllerv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ func NewController(ctx context.Context, watcher configmap.Watcher, configs *conf
}
})

kafkaFeatureStore := apisconfig.NewStore(ctx, func(_ string, value *apisconfig.KafkaFeatureFlags) {
reconciler.KafkaFeatureFlags.Reset(value)
if globalResync != nil {
globalResync()

Check warning on line 113 in control-plane/pkg/reconciler/trigger/v2/controllerv2.go

View check run for this annotation

Codecov / codecov/patch

control-plane/pkg/reconciler/trigger/v2/controllerv2.go#L113

Added line #L113 was not covered by tests
}
})
kafkaFeatureStore.WatchConfigs(watcher)

globalResync = func() {
impl.FilteredGlobalResync(filterTriggers(reconciler.BrokerLister), triggerInformer.Informer())

Check warning on line 119 in control-plane/pkg/reconciler/trigger/v2/controllerv2.go

View check run for this annotation

Codecov / codecov/patch

control-plane/pkg/reconciler/trigger/v2/controllerv2.go#L119

Added line #L119 was not covered by tests
}
Expand Down
4 changes: 4 additions & 0 deletions control-plane/pkg/reconciler/trigger/v2/controllerv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ func TestNewController(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "config-features",
},
}, &corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: "config-kafka-features",
},
}), &config.Env{})
if controller == nil {
t.Error("failed to create controller: <nil>")
Expand Down

0 comments on commit 8b07dc2

Please sign in to comment.