Skip to content

Commit

Permalink
Merge pull request #16 from pfnet/wafrelka/reconcile-log-level-adjust…
Browse files Browse the repository at this point in the history
…ment

Adjust the log level to V(4) for insignificant reconciliation logs
  • Loading branch information
wafrelka-pfn authored Jan 10, 2025
2 parents c1f7072 + fba51b0 commit 4274f54
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions pkg/controllers/clusterthrottle_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func NewClusterThrottleController(
}

func (c *ClusterThrottleController) reconcile(key string) error {
klog.V(2).InfoS("Reconciling ClusterThrottle", "ClusterThrottle", key)
klog.V(4).InfoS("Reconciling ClusterThrottle", "ClusterThrottle", key)
ctx := context.Background()
now := c.clock.Now()

Expand All @@ -108,7 +108,7 @@ func (c *ClusterThrottleController) reconcile(key string) error {
return err
}
if len(affectedNonTerminatedPods)+len(affectedTerminatedPods) > 0 {
klog.V(2).InfoS(
klog.V(4).InfoS(
"Affected pods detected",
"ClusterThrottle", thr.Namespace+"/"+thr.Name,
"#AffectedPods(NonTerminated)", len(affectedNonTerminatedPods),
Expand Down Expand Up @@ -189,7 +189,7 @@ func (c *ClusterThrottleController) reconcile(key string) error {
} else {
c.metricsRecorder.recordClusterThrottleMetrics(thr)
reservedAmt, reservedPodNNs := unreserveAffectedPods()
klog.V(2).InfoS("No need to update status",
klog.V(4).InfoS("No need to update status",
"ClusterThrottle", thr.Namespace+"/"+thr.Name,
"Threshold", thr.Status.CalculatedThreshold.Threshold,
"CalculatedAt", thr.Status.CalculatedThreshold.CalculatedAt,
Expand All @@ -206,7 +206,7 @@ func (c *ClusterThrottleController) reconcile(key string) error {
return err
}
if nextOverrideHappensIn != nil {
klog.V(3).InfoS("Reconciling after duration", "ClusterThrottle", thr.Namespace+"/"+thr.Name, "After", nextOverrideHappensIn)
klog.V(4).InfoS("Reconciling after duration", "ClusterThrottle", thr.Namespace+"/"+thr.Name, "After", nextOverrideHappensIn)
c.enqueueAfter(thr, *nextOverrideHappensIn)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (c *ControllerBase) processNextWorkItem() bool {
}
// get queued again until another change happens.
c.workqueue.Forget(obj)
klog.InfoS("Successfully reconciled", c.targetKind, key)
klog.V(4).InfoS("Successfully reconciled", c.targetKind, key)
return nil
}(obj)

Expand Down
8 changes: 4 additions & 4 deletions pkg/controllers/throttle_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func NewThrottleController(
}

func (c *ThrottleController) reconcile(key string) error {
klog.V(2).InfoS("Reconciling Throttle", "Throttle", key)
klog.V(4).InfoS("Reconciling Throttle", "Throttle", key)
ctx := context.Background()
now := c.clock.Now()

Expand All @@ -105,7 +105,7 @@ func (c *ThrottleController) reconcile(key string) error {
return err
}
if len(affectedNonTerminatedPods)+len(affectedTerminatedPods) > 0 {
klog.V(2).InfoS(
klog.V(4).InfoS(
"Affected pods detected",
"Throttle", thr.Namespace+"/"+thr.Name,
"#AffectedPods(NonTerminated)", len(affectedNonTerminatedPods),
Expand Down Expand Up @@ -186,7 +186,7 @@ func (c *ThrottleController) reconcile(key string) error {
} else {
c.metricsRecorder.recordThrottleMetrics(thr)
reservedAmt, reservedPodNNs := unreserveAffectedPods()
klog.V(2).InfoS("No need to update status",
klog.V(4).InfoS("No need to update status",
"Throttle", thr.Namespace+"/"+thr.Name,
"Threshold", thr.Status.CalculatedThreshold.Threshold,
"CalculatedAt", thr.Status.CalculatedThreshold.CalculatedAt,
Expand All @@ -203,7 +203,7 @@ func (c *ThrottleController) reconcile(key string) error {
return err
}
if nextOverrideHappensIn != nil {
klog.V(3).InfoS("Reconciling after duration", "Throttle", thr.Namespace+"/"+thr.Name, "After", nextOverrideHappensIn)
klog.V(4).InfoS("Reconciling after duration", "Throttle", thr.Namespace+"/"+thr.Name, "After", nextOverrideHappensIn)
c.enqueueAfter(thr, *nextOverrideHappensIn)
}

Expand Down

0 comments on commit 4274f54

Please sign in to comment.