Skip to content

Commit

Permalink
Start informer
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
pierDipi committed Jan 22, 2025
1 parent 9429896 commit 0ee754d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pkg/reconciler/broker/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ package broker

import (
"context"
"os"

"knative.dev/pkg/injection"

"knative.dev/eventing/pkg/auth"

Expand Down Expand Up @@ -60,6 +63,12 @@ const (

var Tracer tracing.Tracer

func init() {
if isTest := os.Getenv("IS_TEST"); isTest != "true" {
injection.Default.RegisterInformer()

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / analyze / Go vulnerability Detection

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / build / Build

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / test / Unit Tests

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / e2e tests (v1.31.4, ./test/e2e)

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / e2e tests (v1.30.8, ./test/e2e)

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / e2e tests (v1.31.4, ./test/experimental)

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / e2e tests (v1.30.8, ./test/experimental)

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / e2e tests (v1.31.4, ./test/conformance)

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / e2e tests (v1.30.8, ./test/conformance)

not enough arguments in call to injection.Default.RegisterInformer

Check failure on line 68 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / analyze / Analyze CodeQL

not enough arguments in call to injection.Default.RegisterInformer
}
}

// NewController initializes the controller and is called by the generated code
// Registers event handlers to enqueue events
func NewController(
Expand All @@ -69,7 +78,12 @@ func NewController(
logger := logging.FromContext(ctx)
brokerInformer := brokerinformer.Get(ctx)
subscriptionInformer := subscriptioninformer.Get(ctx)
endpointsInformer := namespacedinformerfactory.Get(ctx).Core().V1().Endpoints()
endpointsInformer := namespacedinformerfactory.Get(ctx).Core().V1().Endpoints().Informer()

if err := controller.StartInformers(ctx.Done(), endpointsInformer); err != nil {
logger.Fatalw("Failed to start namespaced endpoints informer", zap.Error(err))
}

configmapInformer := configmapinformer.Get(ctx)
secretInformer := secretinformer.Get(ctx)
eventPolicyInformer := eventpolicyinformer.Get(ctx)
Expand Down

0 comments on commit 0ee754d

Please sign in to comment.