Skip to content

Commit e40e43d

Browse files
jentingroboquat
authored andcommitted
Add annotation gitpod.io/startedDisposal once we enter finalize workspace content
Signed-off-by: JenTing Hsiao <[email protected]>
1 parent b97e21a commit e40e43d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,12 @@ func (m *Monitor) finalizeWorkspaceContent(ctx context.Context, wso *workspaceOb
984984
return
985985
}
986986

987+
err := m.manager.markWorkspace(ctx, workspaceID, addMark(startedDisposalAnnotation, util.BooleanTrueString))
988+
if err != nil {
989+
tracing.LogError(span, err)
990+
log.WithError(err).Error("was unable to update pod's start disposal state - this might cause an incorrect disposal state")
991+
}
992+
987993
var disposalStatus *workspaceDisposalStatus
988994
defer func() {
989995
if disposalStatus == nil {
@@ -1090,12 +1096,6 @@ func (m *Monitor) finalizeWorkspaceContent(ctx context.Context, wso *workspaceOb
10901096
cancelReq()
10911097
}()
10921098

1093-
err = m.manager.markWorkspace(ctx, workspaceID, addMark(startedDisposalAnnotation, util.BooleanTrueString))
1094-
if err != nil {
1095-
tracing.LogError(span, err)
1096-
log.WithError(err).Error("was unable to update pod's start disposal state - this might cause an incorrect disposal state")
1097-
}
1098-
10991099
if pvcFeatureEnabled {
11001100
// pvc was created with the name of the pod. see createDefiniteWorkspacePod()
11011101
pvcName := wso.Pod.Name

0 commit comments

Comments
 (0)