feat(agent): Add shutdown lifecycle states and shutdown_script support (#6139)

* feat(api): Add agent shutdown lifecycle states

* feat(agent): Add shutdown_script support

* feat(agent): Add shutdown_script timeout

* feat(site): Support new agent lifecycle states

---

Co-authored-by: Marcin Tojek <marcin@coder.com>
This commit is contained in:
Mathias Fredriksson
2023-03-06 21:34:00 +02:00
committed by GitHub
co-authored by Marcin Tojek
parent 02100c64b5
commit 22e3ff96be
41 changed files with 1439 additions and 635 deletions
+29
View File
@@ -401,6 +401,7 @@ export const MockWorkspaceAgent: TypesGen.WorkspaceAgent = {
lifecycle_state: "starting",
login_before_ready: false,
startup_script_timeout_seconds: 120,
shutdown_script_timeout_seconds: 120,
}
export const MockWorkspaceAgentDisconnected: TypesGen.WorkspaceAgent = {
@@ -478,6 +479,34 @@ export const MockWorkspaceAgentStartError: TypesGen.WorkspaceAgent = {
lifecycle_state: "start_error",
}
export const MockWorkspaceAgentShuttingDown: TypesGen.WorkspaceAgent = {
...MockWorkspaceAgent,
id: "test-workspace-agent-shutting-down",
name: "a-shutting-down-workspace-agent",
lifecycle_state: "shutting_down",
}
export const MockWorkspaceAgentShutdownTimeout: TypesGen.WorkspaceAgent = {
...MockWorkspaceAgent,
id: "test-workspace-agent-shutdown-timeout",
name: "a-workspace-agent-timed-out-while-running-shutdownup-script",
lifecycle_state: "shutdown_timeout",
}
export const MockWorkspaceAgentShutdownError: TypesGen.WorkspaceAgent = {
...MockWorkspaceAgent,
id: "test-workspace-agent-shutdown-error",
name: "a-workspace-agent-errored-while-running-shutdownup-script",
lifecycle_state: "shutdown_error",
}
export const MockWorkspaceAgentOff: TypesGen.WorkspaceAgent = {
...MockWorkspaceAgent,
id: "test-workspace-agent-off",
name: "a-workspace-agent-is-shut-down",
lifecycle_state: "off",
}
export const MockWorkspaceResource: TypesGen.WorkspaceResource = {
agents: [
MockWorkspaceAgent,