Skip to content

Commit b97e21a

Browse files
sagor999roboquat
authored andcommitted
cleanup
1 parent fb05549 commit b97e21a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func actOnPodEvent(ctx context.Context, m actingManager, manager *Manager, statu
306306
m.clearInitializerFromMap(pod.Name)
307307

308308
// if the secret is already gone, this won't error
309-
err := m.deleteWorkspaceSecrets(ctx, pod.Name)
309+
err = m.deleteWorkspaceSecrets(ctx, pod.Name)
310310
if err != nil {
311311
return err
312312
}
@@ -330,7 +330,6 @@ func actOnPodEvent(ctx context.Context, m actingManager, manager *Manager, statu
330330
return nil
331331
}()
332332
if err != nil {
333-
tracing.LogError(span, err)
334333
log.WithError(err).Error("was unable to update pod's disposal state - this will break someone's experience")
335334
}
336335
}
@@ -357,7 +356,7 @@ func actOnPodEvent(ctx context.Context, m actingManager, manager *Manager, statu
357356
// The alternative is to stop the pod only when the workspaceFailedBeforeStoppingAnnotation is present.
358357
// However, that's much more brittle than stopping the workspace twice (something that Kubernetes can handle).
359358
// It is important that we do not fail here if the pod is already gone, i.e. when we lost the race.
360-
err := m.stopWorkspace(ctx, workspaceID, stopWorkspaceNormallyGracePeriod)
359+
err = m.stopWorkspace(ctx, workspaceID, stopWorkspaceNormallyGracePeriod)
361360
if err != nil && !isKubernetesObjNotFoundError(err) {
362361
return xerrors.Errorf("cannot stop workspace: %w", err)
363362
}
@@ -376,7 +375,7 @@ func actOnPodEvent(ctx context.Context, m actingManager, manager *Manager, statu
376375
}
377376

378377
// we're asked to stop the workspace but aren't doing so yet
379-
err := m.stopWorkspace(ctx, workspaceID, gracePeriod)
378+
err = m.stopWorkspace(ctx, workspaceID, gracePeriod)
380379
if err != nil && !isKubernetesObjNotFoundError(err) {
381380
return xerrors.Errorf("cannot stop workspace: %w", err)
382381
}
@@ -423,7 +422,7 @@ func actOnPodEvent(ctx context.Context, m actingManager, manager *Manager, statu
423422

424423
// In case the pod gets evicted we would not know the hostIP that pod ran on anymore.
425424
// In preparation for those cases, we'll add it as an annotation.
426-
err := m.markWorkspace(ctx, workspaceID, addMark(nodeNameAnnotation, wso.NodeName()))
425+
err = m.markWorkspace(ctx, workspaceID, addMark(nodeNameAnnotation, wso.NodeName()))
427426
if err != nil {
428427
log.WithError(err).Warn("was unable to add host IP annotation from/to workspace")
429428
}
@@ -439,7 +438,7 @@ func actOnPodEvent(ctx context.Context, m actingManager, manager *Manager, statu
439438
if !isPodBeingDeleted(pod) {
440439
span.LogKV("event", "pod not being deleted")
441440
// this might be the case if a headless workspace has just completed but has not been deleted by anyone, yet
442-
err := m.stopWorkspace(ctx, workspaceID, stopWorkspaceNormallyGracePeriod)
441+
err = m.stopWorkspace(ctx, workspaceID, stopWorkspaceNormallyGracePeriod)
443442
if err != nil && !isKubernetesObjNotFoundError(err) {
444443
return xerrors.Errorf("cannot stop workspace: %w", err)
445444
}
@@ -518,7 +517,6 @@ func actOnPodEvent(ctx context.Context, m actingManager, manager *Manager, statu
518517
} else {
519518
// We start finalizing the workspace content only after the container is gone. This way we ensure there's
520519
// no process modifying the workspace content as we create the backup.
521-
span.LogKV("event", "called finalizeWorkspaceContent")
522520
go m.finalizeWorkspaceContent(ctx, wso)
523521
}
524522
}

0 commit comments

Comments
 (0)