Skip to content

Commit

Permalink
Added two debugging log messages in reconciler
Browse files Browse the repository at this point in the history
  • Loading branch information
mtesseract committed Mar 1, 2022
1 parent 0d534ef commit 9c5e2fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,13 @@ func WithSelector(s metav1.LabelSelector) Option {
// - Irreconcilable - an error occurred during reconciliation
func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, err error) {
log := r.log.WithValues(strings.ToLower(r.gvk.Kind), req.NamespacedName)
log.V(1).Info("Reconciliation triggered")

obj := &unstructured.Unstructured{}
obj.SetGroupVersionKind(*r.gvk)
err = r.client.Get(ctx, req.NamespacedName, obj)
if apierrors.IsNotFound(err) {
log.V(1).Info("Resource %s/%s not found, nothing to do", req.NamespacedName.Namespace, req.NamespacedName.Name)
return ctrl.Result{}, nil
}
if err != nil {
Expand Down

0 comments on commit 9c5e2fe

Please sign in to comment.