Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reduce deployment operator logging #332

Merged
merged 4 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading