Skip to content

Commit e87e910

Browse files
committed
Change log message levels according to new system
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
1 parent 1bccd95 commit e87e910

File tree

7 files changed

+17
-10
lines changed

7 files changed

+17
-10
lines changed

cmd/compute-domain-controller/cleanup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (m *CleanupManager[T]) cleanup(ctx context.Context) {
123123
continue
124124
}
125125

126-
klog.Infof("Cleanup: stale %T found for ComputeDomain '%s', running callback", *new(T), uid)
126+
klog.V(1).Infof("Cleanup: stale %T found for ComputeDomain '%s', running callback", *new(T), uid)
127127
if err := m.callback(ctx, uid); err != nil {
128128
klog.Errorf("error running CleanupManager callback: %v", err)
129129
continue

cmd/compute-domain-controller/computedomain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func (m *ComputeDomainManager) onAddOrUpdate(ctx context.Context, obj any) error
232232
return fmt.Errorf("failed to cast to ComputeDomain")
233233
}
234234

235-
klog.Infof("Processing added or updated ComputeDomain: %s/%s/%s", cd.Namespace, cd.Name, cd.UID)
235+
klog.V(2).Infof("Processing added or updated ComputeDomain: %s/%s/%s", cd.Namespace, cd.Name, cd.UID)
236236

237237
if cd.GetDeletionTimestamp() != nil {
238238
if err := m.resourceClaimTemplateManager.Delete(ctx, string(cd.UID)); err != nil {

cmd/compute-domain-controller/daemonset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ func (m *DaemonSetManager) onAddOrUpdate(ctx context.Context, obj any) error {
363363
return fmt.Errorf("failed to cast to DaemonSet")
364364
}
365365

366-
klog.Infof("Processing added or updated DaemonSet: %s/%s", d.Namespace, d.Name)
366+
klog.V(2).Infof("Processing added or updated DaemonSet: %s/%s", d.Namespace, d.Name)
367367

368368
cd, err := m.getComputeDomain(d.Labels[computeDomainLabelKey])
369369
if err != nil {

cmd/compute-domain-kubelet-plugin/device_state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (s *DeviceState) Unprepare(ctx context.Context, claimRef kubeletplugin.Name
212212
// device was never prepared or has already been unprepared (assume that
213213
// Prepare+Checkpoint are done transactionally). Note that
214214
// claimRef.String() contains namespace, name, UID.
215-
klog.Infof("unprepare noop: claim not found in checkpoint data: %v", claimRef.String())
215+
klog.V(2).Infof("unprepare noop: claim not found in checkpoint data: %v", claimRef.String())
216216
return nil
217217
}
218218

cmd/compute-domain-kubelet-plugin/driver.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ func (d *driver) UnprepareResourceClaims(ctx context.Context, claimRefs []kubele
199199
if done {
200200
results[claim.UID] = err
201201
wg.Done()
202+
if err != nil {
203+
klog.V(0).Infof("Permanent error unpreparing devices for claim %v: %v", claim.UID, err)
204+
}
202205
return nil
203206
}
204207
return fmt.Errorf("%w", err)
@@ -248,13 +251,14 @@ func (d *driver) nodePrepareResource(ctx context.Context, claim *resourceapi.Res
248251
Err: fmt.Errorf("error preparing devices for claim %s/%s:%s: %w", claim.Namespace, claim.Name, claim.UID, err),
249252
}
250253
if isPermanentError(err) {
251-
klog.V(6).Infof("Permanent error preparing devices for claim %v: %v", claim.UID, err)
254+
klog.V(0).Infof("Permanent error preparing devices for claim %v: %v", claim.UID, err)
252255
return true, res
253256
}
254257
return false, res
255258
}
256259

257-
klog.Infof("prepared devices for claim '%s/%s:%s': %v", claim.Namespace, claim.Name, claim.UID, devs)
260+
klog.V(1).Infof("prepared devices for claim '%s/%s:%s': %v", claim.Namespace, claim.Name, claim.UID, devs)
261+
258262
return true, kubeletplugin.PrepareResult{Devices: devs}
259263
}
260264

@@ -269,7 +273,7 @@ func (d *driver) nodeUnprepareResource(ctx context.Context, claimRef kubeletplug
269273
return isPermanentError(err), fmt.Errorf("error unpreparing devices for claim '%v': %w", claimRef.String(), err)
270274
}
271275

272-
klog.Infof("unprepared devices for claim '%v'", claimRef.String())
276+
klog.V(1).Infof("Unprepared devices for claim '%v'", claimRef.String())
273277
return true, nil
274278
}
275279

cmd/compute-domain-kubelet-plugin/health.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ func (h *healthcheck) Check(ctx context.Context, req *grpc_health_v1.HealthCheck
130130
klog.ErrorS(err, "failed to call GetInfo")
131131
return status, nil
132132
}
133-
klog.V(6).Infof("Successfully invoked GetInfo: %v", info)
133+
klog.V(7).Infof("Successfully invoked GetInfo: %v", info)
134134

135135
_, err = h.draClient.NodePrepareResources(ctx, &drapb.NodePrepareResourcesRequest{})
136136
if err != nil {
137137
klog.ErrorS(err, "failed to call NodePrepareResources")
138138
return status, nil
139139
}
140-
klog.V(6).Info("Successfully invoked NodePrepareResources")
140+
klog.V(7).Info("Successfully invoked NodePrepareResources")
141141

142142
status.Status = grpc_health_v1.HealthCheckResponse_SERVING
143143
return status, nil

pkg/workqueue/workqueue.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ func (q *WorkQueue) processNextWorkItem(ctx context.Context) {
135135

136136
err := q.reconcile(ctx, workItem)
137137
if err != nil {
138-
klog.Errorf("Failed to reconcile work item: %v", err)
138+
// Most often, this is an expected, retryable error in the context of an
139+
// eventually consistent system. Hence, do not log an error level. Rely
140+
// on inner business logic to log unexpected errors on error level.
141+
klog.V(1).Infof("Reconcile: %v", err)
139142
// Only retry if we're still the current operation for this key
140143
q.Lock()
141144
if q.activeOps[workItem.Key] != nil && q.activeOps[workItem.Key] != workItem {

0 commit comments

Comments
 (0)