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

Commita665b5c

Browse files
committed
fix(agent/agentcontainers): remove deleted devcontainers
1 parent4fd0312 commita665b5c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎agent/agentcontainers/api.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,18 @@ func (api *API) processUpdatedContainersLocked(ctx context.Context, updated code
661661

662662
casedc.Container==nil:
663663
if!api.devcontainerNames[dc.Name] {
664-
dc.Name=""
664+
// If this is a runtime-detected container, check if we
665+
// should remove it.
666+
// TODO(mafredri): Consider using afero.
667+
if_,err:=os.Stat(dc.WorkspaceFolder);errors.Is(err,os.ErrNotExist) {
668+
// If the workspace folder doesn't exist, we can assume
669+
// that the devcontainer is no longer valid and should be
670+
// removed.
671+
logger.Debug(ctx,"devcontainer workspace folder does not exist, removing devcontainer")
672+
delete(api.knownDevcontainers,dc.WorkspaceFolder)
673+
// TODO(mafredri): Delete the agent if it exists.
674+
continue
675+
}
665676
}
666677
dc.Status=codersdk.WorkspaceAgentDevcontainerStatusStopped
667678
dc.Dirty=false

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp