Skip to content

Commit

Permalink
reduce deployment operator logging
Browse files Browse the repository at this point in the history
  • Loading branch information
zreigz committed Dec 20, 2024
1 parent 1ea16be commit 0cb3b65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions pkg/controller/service/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (s *ServiceReconciler) Poll(ctx context.Context) error {
continue
}

logger.Info("sending update for", "service", svc.Node.ID)
logger.V(4).Info("sending update for", "service", svc.Node.ID)
s.svcQueue.Add(svc.Node.ID)
}
}
Expand All @@ -308,12 +308,12 @@ func (s *ServiceReconciler) Reconcile(ctx context.Context, id string) (result re
ctx = context.WithValue(ctx, metrics.ContextKeyTimeStart, start)

logger := log.FromContext(ctx)
logger.Info("attempting to sync service", "id", id)
logger.V(4).Info("attempting to sync service", "id", id)

svc, err := s.svcCache.Get(id)
if err != nil {
if clienterrors.IsNotFound(err) {
logger.Info("service already deleted", "id", id)
logger.V(4).Info("service already deleted", "id", id)
return reconcile.Result{}, nil
}
logger.Error(err, fmt.Sprintf("failed to fetch service: %s, ignoring for now", id))
Expand Down Expand Up @@ -349,10 +349,10 @@ func (s *ServiceReconciler) Reconcile(ctx context.Context, id string) (result re
return
}

logger.Info("syncing service", "name", svc.Name, "namespace", svc.Namespace)
logger.V(2).Info("syncing service", "name", svc.Name, "namespace", svc.Namespace)

if svc.DeletedAt != nil {
logger.Info("Deleting service", "name", svc.Name, "namespace", svc.Namespace)
logger.V(2).Info("Deleting service", "name", svc.Name, "namespace", svc.Namespace)
ch := s.destroyer.Run(ctx, inventory.WrapInventoryInfoObj(s.defaultInventoryObjTemplate(id)), apply.DestroyerOptions{
InventoryPolicy: inventory.PolicyAdoptIfNoInventory,
DryRunStrategy: common.DryRunNone,
Expand All @@ -367,14 +367,14 @@ func (s *ServiceReconciler) Reconcile(ctx context.Context, id string) (result re
return
}

logger.Info("Fetching manifests", "service", svc.Name)
logger.V(4).Info("Fetching manifests", "service", svc.Name)
manifests, err := s.manifestCache.Fetch(s.utilFactory, svc)
if err != nil {
logger.Error(err, "failed to parse manifests", "service", svc.Name)
return
}
manifests = postProcess(manifests)
logger.Info("Syncing manifests", "count", len(manifests))
logger.V(4).Info("Syncing manifests", "count", len(manifests))
invObj, manifests, err := s.SplitObjects(id, manifests)
if err != nil {
return
Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/service/reconciler_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,23 @@ func FormatSummary(ctx context.Context, namespace, name string, s stats.Stats) e

if s.ApplyStats != (stats.ApplyStats{}) {
as := s.ApplyStats
logger.Info(fmt.Sprintf("apply result for %s/%s: %d attempted, %d successful, %d skipped, %d failed",
logger.V(4).Info(fmt.Sprintf("apply result for %s/%s: %d attempted, %d successful, %d skipped, %d failed",
namespace, name, as.Sum(), as.Successful, as.Skipped, as.Failed))
}
if s.PruneStats != (stats.PruneStats{}) {
ps := s.PruneStats
logger.Info(fmt.Sprintf("prune result for %s/%s: %d attempted, %d successful, %d skipped, %d failed",
logger.V(4).Info(fmt.Sprintf("prune result for %s/%s: %d attempted, %d successful, %d skipped, %d failed",
namespace, name, ps.Sum(), ps.Successful, ps.Skipped, ps.Failed))
}
if s.DeleteStats != (stats.DeleteStats{}) {
ds := s.DeleteStats
logger.Info(fmt.Sprintf("delete result for %s/%s: %d attempted, %d successful, %d skipped, %d failed",
logger.V(4).Info(fmt.Sprintf("delete result for %s/%s: %d attempted, %d successful, %d skipped, %d failed",
namespace, name, ds.Sum(), ds.Successful, ds.Skipped, ds.Failed))
}
if s.WaitStats != (stats.WaitStats{}) {
ws := s.WaitStats
logger.Info(fmt.Sprintf("reconcile result for %s/%s: %d attempted, %d successful, %d skipped, %d failed, %d timed out",
namespace, name, ws.Sum(), ws.Successful, ws.Skipped, ws.Failed, ws.Timeout))
logger.Info(fmt.Sprintf("reconcile result for %s/%s: %d attempted, %d successful %d failed",
namespace, name, ws.Sum(), ws.Successful, ws.Failed))
}
return nil
}
Expand Down

0 comments on commit 0cb3b65

Please sign in to comment.