mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(agent): support deleting dev containers (#21247)
Add logic to the agent, and an endpoint, to allow requesting and then deleting a Dev Container and its related agent.
This commit is contained in:
@@ -401,9 +401,22 @@ const (
|
||||
WorkspaceAgentDevcontainerStatusRunning WorkspaceAgentDevcontainerStatus = "running"
|
||||
WorkspaceAgentDevcontainerStatusStopped WorkspaceAgentDevcontainerStatus = "stopped"
|
||||
WorkspaceAgentDevcontainerStatusStarting WorkspaceAgentDevcontainerStatus = "starting"
|
||||
WorkspaceAgentDevcontainerStatusStopping WorkspaceAgentDevcontainerStatus = "stopping"
|
||||
WorkspaceAgentDevcontainerStatusDeleting WorkspaceAgentDevcontainerStatus = "deleting"
|
||||
WorkspaceAgentDevcontainerStatusError WorkspaceAgentDevcontainerStatus = "error"
|
||||
)
|
||||
|
||||
func (s WorkspaceAgentDevcontainerStatus) Transitioning() bool {
|
||||
switch s {
|
||||
case WorkspaceAgentDevcontainerStatusStarting,
|
||||
WorkspaceAgentDevcontainerStatusStopping,
|
||||
WorkspaceAgentDevcontainerStatusDeleting:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// WorkspaceAgentDevcontainer defines the location of a devcontainer
|
||||
// configuration in a workspace that is visible to the workspace agent.
|
||||
type WorkspaceAgentDevcontainer struct {
|
||||
|
||||
Reference in New Issue
Block a user