-
Notifications
You must be signed in to change notification settings - Fork 74
Use wire-gen injection for all controllers #1733
Conversation
afff56b
to
335ecab
Compare
/assign @grantr |
/assign @ian-mi |
pkg/reconciler/trigger/controller.go
Outdated
} | ||
} | ||
|
||
func newController(ctx context.Context, cmw configmap.Watcher, dataresidencyss *dataresidency.Store) *controller.Impl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func newController(ctx context.Context, cmw configmap.Watcher, dataresidencyss *dataresidency.Store) *controller.Impl { | |
func newController(ctx context.Context, cmw configmap.Watcher, drs *dataresidency.Store) *controller.Impl { |
pkg/reconciler/broker/controller.go
Outdated
} | ||
} | ||
|
||
func newController(ctx context.Context, cmw configmap.Watcher, dataresidencyss *dataresidency.Store) *controller.Impl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func newController(ctx context.Context, cmw configmap.Watcher, dataresidencyss *dataresidency.Store) *controller.Impl { | |
func newController(ctx context.Context, cmw configmap.Watcher, drs *dataresidency.Store) *controller.Impl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I was planning to change the name last Friday but somehow it skipped my mind. Thanks.
@@ -44,7 +44,11 @@ import ( | |||
func TestNew(t *testing.T) { | |||
ctx, _ := SetupFakeContext(t) | |||
|
|||
c := NewController(ctx, configmap.NewStaticWatcher( | |||
dataresidencySs := &dataresidency.StoreSingleton{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline this, as we don't use it again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as suggested.
@@ -38,7 +38,11 @@ import ( | |||
func TestNew(t *testing.T) { | |||
ctx, _ := SetupFakeContext(t) | |||
|
|||
c := NewController(ctx, configmap.NewStaticWatcher( | |||
dataresidencySs := &dataresidency.StoreSingleton{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline this, as we don't use it again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as suggested.
@@ -38,7 +38,9 @@ import ( | |||
func TestNew(t *testing.T) { | |||
ctx, _ := SetupFakeContext(t) | |||
|
|||
c := NewController(ctx, configmap.NewStaticWatcher( | |||
ctor := NewConstructor(&dataresidency.StoreSingleton{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would inline the constructor as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as suggested.
@@ -48,7 +48,9 @@ func TestNew(t *testing.T) { | |||
|
|||
setReconcilerEnv() | |||
|
|||
c := NewController(ctx, configmap.NewStaticWatcher( | |||
ctor := NewConstructor() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as suggested.
@@ -31,7 +31,9 @@ import ( | |||
func TestNew(t *testing.T) { | |||
ctx, _ := SetupFakeContext(t) | |||
|
|||
c := NewController(ctx, configmap.NewStaticWatcher()) | |||
ctor := NewConstructor() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as suggested.
@@ -44,7 +44,9 @@ import ( | |||
func TestNew(t *testing.T) { | |||
ctx, _ := SetupFakeContext(t) | |||
|
|||
c := NewController(ctx, configmap.NewStaticWatcher( | |||
ctor := NewConstructor(&dataresidency.StoreSingleton{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as suggested.
…egions in dataresidency configmap
The following is the coverage report on the affected files.
|
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ian-mi, zhongduo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
The following jobs failed:
Job pull-google-knative-gcp-wi-tests expended all 3 retries without success. |
/retest |
Fixes #
Currently some controllers are not using wire-gen. By changing all controller to the same style we can achieve:
This PR will be rebased after merge of #1681
Proposed Changes