@@ -203,9 +203,9 @@ In this new layout, `main.go` constructs the reconciler:
203
203
// ...
204
204
func main () {
205
205
// ...
206
- err := &controllers.MyReconciler {
206
+ err := ( &controllers.MyReconciler {
207
207
MySuperSpecialAppClient: doSomeThingsWithFlags (),
208
- }.SetupWithManager (mgr)
208
+ }) .SetupWithManager (mgr)
209
209
// ...
210
210
}
211
211
```
@@ -214,7 +214,7 @@ while `mykind_controller.go` actually sets up the controller using the
214
214
reconciler:
215
215
216
216
``` go
217
- func (r *myReconciler ) SetupWithManager (mgr ctrl .Manager ) error {
217
+ func (r *MyReconciler ) SetupWithManager (mgr ctrl .Manager ) error {
218
218
return ctrl.NewControllerManagedBy (mgr).
219
219
For (&api.MyAppType {}).
220
220
Owns (&corev1.Pod {}).
@@ -425,10 +425,10 @@ func main() {
425
425
os.Exit (1 )
426
426
}
427
427
428
- err = controllers.MyKindReconciler {
428
+ err = (& controllers.MyKindReconciler {
429
429
Client: mgr.GetClient (),
430
430
log: ctrl.Log .WithName (" mykind-controller" ),
431
- }.SetupWithManager (mgr)
431
+ }) .SetupWithManager (mgr)
432
432
if err != nil {
433
433
setupLog.Error (err, " unable to create controller" , " controller" , " mykind" )
434
434
os.Exit (1 )
@@ -463,12 +463,12 @@ import (
463
463
" my.repo/api/v1"
464
464
)
465
465
466
- type myKindReconciler struct {
466
+ type MyKindReconciler struct {
467
467
client.Client
468
468
log logr.Logger
469
469
}
470
470
471
- func (r *myKindReconciler ) Reconcile (req ctrl .Request ) (ctrl .Result , error ) {
471
+ func (r *MyKindReconciler ) Reconcile (req ctrl .Request ) (ctrl .Result , error ) {
472
472
ctx := context.Background ()
473
473
log := r.log .WithValues (" mykind" , req.NamespacedName )
474
474
@@ -477,7 +477,7 @@ func (r *myKindReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
477
477
return req.Result {}, nil
478
478
}
479
479
480
- func (r *myKindReconciler ) SetupWithManager (mgr ctrl .Manager ) error {
480
+ func (r *MyKindReconciler ) SetupWithManager (mgr ctrl .Manager ) error {
481
481
return ctrl.NewControllerManagedBy (mgr).
482
482
For (v1.MyKind {}).
483
483
Complete (r)
0 commit comments