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

fix(agent/agentcontainers): remove deleted devcontainers#18545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
mafredri wants to merge1 commit intomain
base:main
Choose a base branch
Loading
frommafredri/fix-agent-agentcontainers-remove-deleted-devcontainers
Draft
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletionsagent/agentcontainers/api.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -660,8 +660,19 @@ func (api *API) processUpdatedContainersLocked(ctx context.Context, updated code
}

case dc.Container == nil:
if !api.devcontainerNames[dc.Name] {
dc.Name = ""
if !api.devcontainerNames[dc.Name] { // TODO(mafredri): Change this, not stable after https://github.com/coder/coder/pull/18513
// If this is a runtime-detected container, check if we
// should remove it.
// TODO(mafredri): Consider using afero.
if _, err := os.Stat(dc.WorkspaceFolder); errors.Is(err, os.ErrNotExist) {
// If the workspace folder doesn't exist, we can assume
// that the devcontainer is no longer valid and should be
// removed.
logger.Debug(ctx, "devcontainer workspace folder does not exist, removing devcontainer")
delete(api.knownDevcontainers, dc.WorkspaceFolder)
// TODO(mafredri): Delete the agent if it exists.
continue
}
}
dc.Status = codersdk.WorkspaceAgentDevcontainerStatusStopped
dc.Dirty = false
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp