Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo6Leo committed Oct 16, 2023
1 parent 1771016 commit ef2afbe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
13 changes: 12 additions & 1 deletion pkg/reconciler/pingsource/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package pingsource

import (
"context"

serviceaccountinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount"

"go.uber.org/zap"
Expand Down Expand Up @@ -61,7 +62,13 @@ func NewController(
logger.Fatalw("Error converting leader election configuration to JSON", zap.Error(err))
}

featureStore := feature.NewStore(logging.FromContext(ctx).Named("feature-config-store"))
var globalResync func(obj interface{})

featureStore := feature.NewStore(logging.FromContext(ctx).Named("feature-config-store"), func(name string, value interface{}) {
if globalResync != nil {
globalResync(nil)
}
})
featureStore.WatchConfigs(cmw)

// Configure the reconciler
Expand All @@ -83,6 +90,10 @@ func NewController(
}
})

globalResync = func(interface{}) {
impl.GlobalResync(pingSourceInformer.Informer())
}

r.sinkResolver = resolver.NewURIResolver(ctx, cmw, impl.Tracker)

pingSourceInformer.Informer().AddEventHandler(controller.HandleAll(impl.Enqueue))
Expand Down
1 change: 1 addition & 0 deletions pkg/reconciler/pingsource/pingsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"encoding/json"
"fmt"

v1 "k8s.io/client-go/listers/core/v1"
"knative.dev/eventing/pkg/apis/feature"
"knative.dev/eventing/pkg/auth"
Expand Down
5 changes: 3 additions & 2 deletions pkg/reconciler/pingsource/pingsource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ package pingsource
import (
"context"
"fmt"
"knative.dev/eventing/pkg/apis/feature"
"knative.dev/eventing/pkg/auth"
"os"
"testing"

"knative.dev/eventing/pkg/apis/feature"
"knative.dev/eventing/pkg/auth"

cloudevents "github.com/cloudevents/sdk-go/v2"
"k8s.io/utils/pointer"

Expand Down
3 changes: 2 additions & 1 deletion pkg/reconciler/testing/v1/pingsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package testing
import (
"context"
"fmt"
"knative.dev/eventing/pkg/apis/feature"
"time"

"knative.dev/eventing/pkg/apis/feature"

"knative.dev/eventing/pkg/reconciler/testing"

duckv1 "knative.dev/pkg/apis/duck/v1"
Expand Down

0 comments on commit ef2afbe

Please sign in to comment.