Skip to content

Commit fbbec7b

Browse files
sagor999roboquat
authored andcommitted
[ws-manager] fix finalizeWorkspaceContent can be called twice
1 parent f9531f3 commit fbbec7b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,9 @@ func actOnPodEvent(ctx context.Context, m actingManager, status *api.WorkspaceSt
376376
}
377377

378378
_, gone := wso.Pod.Annotations[wsk8s.ContainerIsGoneAnnotation]
379+
_, alreadyFinalized := wso.Pod.Annotations[disposalStatusAnnotation]
379380

380-
if terminated || gone {
381+
if (terminated || gone) && !alreadyFinalized {
381382
// We start finalizing the workspace content only after the container is gone. This way we ensure there's
382383
// no process modifying the workspace content as we create the backup.
383384
go m.finalizeWorkspaceContent(ctx, wso)

0 commit comments

Comments
 (0)