Skip to content

Commit dcf4b8b

Browse files
committed
Fix lint.
1 parent a03f404 commit dcf4b8b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

pkg/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func NewTypedUnmanaged[request comparable](name string, options TypedOptions[req
260260
}
261261

262262
// Create controller with dependencies set
263-
return controller.New[request](controller.ControllerOptions[request]{
263+
return controller.New[request](controller.Options[request]{
264264
Do: options.Reconciler,
265265
RateLimiter: options.RateLimiter,
266266
NewQueue: options.NewQueue,

pkg/internal/controller/controller.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ import (
3838
"sigs.k8s.io/controller-runtime/pkg/source"
3939
)
4040

41-
type ControllerOptions[request comparable] struct {
41+
// Options are the arguments for creating a new Controller.
42+
type Options[request comparable] struct {
4243
// Reconciler is a function that can be called at any time with the Name / Namespace of an object and
4344
// ensures that the state of the system matches the state specified in the object.
4445
// Defaults to the DefaultReconcileFunc.
@@ -129,7 +130,7 @@ type Controller[request comparable] struct {
129130

130131
// startedEventSources is used to track if the event sources have been started.
131132
// It ensures that we append sources to c.startWatches only until we call Start() / Warmup()
132-
// It is true if startEventSourcesLocked has been called at least once.
133+
// It is true if startEventSourcesLocked has been called at least once.
133134
startedEventSources bool
134135

135136
// didStartEventSourcesOnce is used to ensure that the event sources are only started once.
@@ -162,7 +163,8 @@ type Controller[request comparable] struct {
162163
EnableWarmup *bool
163164
}
164165

165-
func New[request comparable](options ControllerOptions[request]) *Controller[request] {
166+
// New returns a new Controller configured with the given options.
167+
func New[request comparable](options Options[request]) *Controller[request] {
166168
return &Controller[request]{
167169
Do: options.Do,
168170
RateLimiter: options.RateLimiter,

pkg/internal/controller/controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var _ = Describe("controller", func() {
7272
queue = &controllertest.Queue{
7373
TypedInterface: workqueue.NewTyped[reconcile.Request](),
7474
}
75-
ctrl = New[reconcile.Request](ControllerOptions[reconcile.Request]{
75+
ctrl = New[reconcile.Request](Options[reconcile.Request]{
7676
MaxConcurrentReconciles: 1,
7777
Do: fakeReconcile,
7878
NewQueue: func(string, workqueue.TypedRateLimiter[reconcile.Request]) workqueue.TypedRateLimitingInterface[reconcile.Request] {
@@ -353,7 +353,7 @@ var _ = Describe("controller", func() {
353353
TypedRateLimitingInterface: &controllertest.TypedQueue[TestRequest]{
354354
TypedInterface: workqueue.NewTyped[TestRequest](),
355355
}}
356-
ctrl := New[TestRequest](ControllerOptions[TestRequest]{
356+
ctrl := New[TestRequest](Options[TestRequest]{
357357
NewQueue: func(string, workqueue.TypedRateLimiter[TestRequest]) workqueue.TypedRateLimitingInterface[TestRequest] {
358358
return queue
359359
},
@@ -1192,7 +1192,7 @@ var _ = Describe("controller", func() {
11921192
}),
11931193
}
11941194

1195-
nonWarmupCtrl := New[reconcile.Request](ControllerOptions[reconcile.Request]{
1195+
nonWarmupCtrl := New[reconcile.Request](Options[reconcile.Request]{
11961196
MaxConcurrentReconciles: 1,
11971197
Do: fakeReconcile,
11981198
NewQueue: func(string, workqueue.TypedRateLimiter[reconcile.Request]) workqueue.TypedRateLimitingInterface[reconcile.Request] {

0 commit comments

Comments
 (0)