Skip to content

Commit f4dc1d7

Browse files
committed
Use correct log variable to include OWI information in each log entry
Signed-off-by: JenTing Hsiao <[email protected]>
1 parent 6d6c73b commit f4dc1d7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

components/ws-manager/pkg/manager/manager.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
175175
clog.Info("StartWorkspace")
176176
reqs, _ := protojson.Marshal(req)
177177
safeReqs, _ := log.RedactJSON(reqs)
178-
log.WithField("req", string(safeReqs)).Debug("StartWorkspace request received")
178+
clog.WithField("req", string(safeReqs)).Debug("StartWorkspace request received")
179179

180180
// Make sure the objects we're about to create do not exist already
181181
switch req.Type {
@@ -248,11 +248,11 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
248248
// restore volume snapshot from handle
249249
err = m.restoreVolumeSnapshotFromHandle(ctx, startContext.VolumeSnapshot.VolumeSnapshotName, startContext.VolumeSnapshot.VolumeSnapshotHandle)
250250
if err != nil {
251-
log.WithError(err).Error("was unable to restore volume snapshot")
251+
clog.WithError(err).Error("was unable to restore volume snapshot")
252252
return nil, err
253253
}
254254
} else if err != nil {
255-
log.WithError(err).Error("was unable to get volume snapshot")
255+
clog.WithError(err).Error("was unable to get volume snapshot")
256256
return nil, err
257257
}
258258
}
@@ -330,10 +330,10 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
330330
if err != nil {
331331
if startContext.VolumeSnapshot != nil && startContext.VolumeSnapshot.VolumeSnapshotName != "" {
332332
m.eventRecorder.Eventf(pod, corev1.EventTypeWarning, "PVC", "PVC %q restored from volume snapshot %s failed %v", pvc.Name, startContext.VolumeSnapshot.VolumeSnapshotName, err)
333-
log.WithError(err).Warnf("unexpected error waiting for PVC %s volume snapshot %s", pvc.Name, startContext.VolumeSnapshot.VolumeSnapshotName)
333+
clog.WithError(err).Warnf("unexpected error waiting for PVC %s volume snapshot %s", pvc.Name, startContext.VolumeSnapshot.VolumeSnapshotName)
334334
} else {
335335
m.eventRecorder.Eventf(pod, corev1.EventTypeWarning, "PVC", "PVC %q created failed %v", pvc.Name, err)
336-
log.WithError(err).Warnf("unexpected error waiting for PVC %s", pvc.Name)
336+
clog.WithError(err).Warnf("unexpected error waiting for PVC %s", pvc.Name)
337337
}
338338
} else {
339339
if startContext.VolumeSnapshot != nil && startContext.VolumeSnapshot.VolumeSnapshotName != "" {
@@ -342,7 +342,7 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
342342
wsType := api.WorkspaceType_name[int32(req.Type)]
343343
hist, err := m.metrics.volumeRestoreTimeHistVec.GetMetricWithLabelValues(wsType, req.Spec.Class)
344344
if err != nil {
345-
log.WithError(err).WithField("type", wsType).Warn("cannot get volume restore time histogram metric")
345+
clog.WithError(err).WithField("type", wsType).Warn("cannot get volume restore time histogram metric")
346346
} else if endTime.IsZero() {
347347
endTime = time.Now()
348348
hist.Observe(endTime.Sub(startTime).Seconds())

0 commit comments

Comments
 (0)