Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Fix: add logger definition in playbookexecution controller
Browse files Browse the repository at this point in the history
Signed-off-by: Gloria Ciavarrini <[email protected]>
  • Loading branch information
gciavarrini authored and eloycoto committed Oct 6, 2022
1 parent 7fff297 commit 3591f8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controllers/playbookexecution_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/predicate"

"github.com/project-flotta/flotta-operator/api/v1alpha1"
Expand Down Expand Up @@ -54,6 +55,9 @@ type PlaybookExecutionReconciler struct {
// For more details, check Reconcile and its Result here:
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile
func (r *PlaybookExecutionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
logger := log.FromContext(ctx)
logger.Info("Reconciling", "playbookExecution", req)

playbookExec, err := r.PlaybookExecutionRepository.Read(ctx, req.Name, req.Namespace)
if err != nil {
if errors.IsNotFound(err) {
Expand All @@ -78,7 +82,7 @@ func (r *PlaybookExecutionReconciler) Reconcile(ctx context.Context, req ctrl.Re
}
return ctrl.Result{Requeue: true}, err
}
logger.Info(">>> edgeDevice found", "edgeDevice", edgeDevice)
logger.Info("edgeDevice found", "edgeDevice", edgeDevice)
return ctrl.Result{}, nil
}

Expand Down

0 comments on commit 3591f8d

Please sign in to comment.