Skip to content

Commit

Permalink
added reconciler logger to test/dockercluster
Browse files Browse the repository at this point in the history
  • Loading branch information
killianmuldoon committed Aug 25, 2021
1 parent 0802d64 commit 034f259
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ package controllers
import (
"context"

"sigs.k8s.io/controller-runtime/pkg/controller"

"github.com/go-logr/logr"
"github.com/pkg/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -186,7 +188,8 @@ func (r *DockerClusterReconciler) reconcileDelete(ctx context.Context, dockerClu
}

// SetupWithManager will add watches for this controller.
func (r *DockerClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
func (r *DockerClusterReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error {
options.Log = mgr.GetLogger().WithValues("reconciler", "DockerClusterReconciler")
c, err := ctrl.NewControllerManagedBy(mgr).
For(&infrav1.DockerCluster{}).
WithEventFilter(predicates.ResourceNotPaused(r.Log)).
Expand Down
2 changes: 1 addition & 1 deletion test/infrastructure/docker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) {
if err := (&controllers.DockerClusterReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("DockerCluster"),
}).SetupWithManager(mgr); err != nil {
}).SetupWithManager(mgr, controller.Options{}); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "DockerCluster")
os.Exit(1)
}
Expand Down

0 comments on commit 034f259

Please sign in to comment.