Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb135381

Browse files
committed
chore: address comments
1 parentb0cde3b commitb135381

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

‎enterprise/coderd/prebuilds/reconcile.go‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ const (
6464
DeprovisionModeOrphan
6565
)
6666

67+
func (dDeprovisionMode)String()string {
68+
switchd {
69+
caseDeprovisionModeOrphan:
70+
return"orphan"
71+
caseDeprovisionModeNormal:
72+
return"normal"
73+
default:
74+
return"unknown"
75+
}
76+
}
77+
6778
funcNewStoreReconciler(store database.Store,
6879
ps pubsub.Pubsub,
6980
fileCache*files.Cache,
@@ -728,8 +739,8 @@ func (c *StoreReconciler) provisionDelete(ctx context.Context, db database.Store
728739
returnxerrors.Errorf("prebuilt workspace is not owned by prebuild user anymore, probably it was claimed")
729740
}
730741

731-
c.logger.Info(ctx,"attempting to delete prebuild",
732-
slog.F("workspace_id",workspaceID.String()),slog.F("preset_id",presetID.String()))
742+
c.logger.Info(ctx,"attempting to delete prebuild",slog.F("orphan",mode.String()),
743+
slog.F("name",workspace.Name),slog.F("workspace_id",workspaceID.String()),slog.F("preset_id",presetID.String()))
733744

734745
returnc.provision(ctx,db,workspaceID,template,presetID,
735746
database.WorkspaceTransitionDelete,workspace,mode)

‎enterprise/coderd/prebuilds/reconcile_test.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ func TestPrebuildReconciliation(t *testing.T) {
204204
templateDeleted: []bool{false},
205205
},
206206
{
207+
// TODO(ssncferreira): Investigate why the GetRunningPrebuiltWorkspaces query is returning 0 rows.
208+
// When a template version is inactive (templateVersionActive = false), any prebuilds in the
209+
// database.ProvisionerJobStatusRunning state should be deleted.
207210
name:"never attempt to interfere with prebuilds from an active template version",
208211
// The workspace builder does not allow scheduling a new build if there is already a build
209212
// pending, running, or canceling. As such, we should never attempt to start, stop or delete

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp