mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: allow multiple agent subsystems, add exectrace (#8933)
This commit is contained in:
@@ -612,9 +612,9 @@ func (c *Client) PostLifecycle(ctx context.Context, req PostLifecycleRequest) er
|
||||
}
|
||||
|
||||
type PostStartupRequest struct {
|
||||
Version string `json:"version"`
|
||||
ExpandedDirectory string `json:"expanded_directory"`
|
||||
Subsystem codersdk.AgentSubsystem `json:"subsystem"`
|
||||
Version string `json:"version"`
|
||||
ExpandedDirectory string `json:"expanded_directory"`
|
||||
Subsystems []codersdk.AgentSubsystem `json:"subsystems"`
|
||||
}
|
||||
|
||||
func (c *Client) PostStartup(ctx context.Context, req PostStartupRequest) error {
|
||||
|
||||
@@ -167,7 +167,7 @@ type WorkspaceAgent struct {
|
||||
LoginBeforeReady bool `json:"login_before_ready"`
|
||||
ShutdownScript string `json:"shutdown_script,omitempty"`
|
||||
ShutdownScriptTimeoutSeconds int32 `json:"shutdown_script_timeout_seconds"`
|
||||
Subsystem AgentSubsystem `json:"subsystem"`
|
||||
Subsystems []AgentSubsystem `json:"subsystems"`
|
||||
Health WorkspaceAgentHealth `json:"health"` // Health reports the health of the agent.
|
||||
}
|
||||
|
||||
@@ -754,9 +754,20 @@ type WorkspaceAgentLog struct {
|
||||
type AgentSubsystem string
|
||||
|
||||
const (
|
||||
AgentSubsystemEnvbox AgentSubsystem = "envbox"
|
||||
AgentSubsystemEnvbox AgentSubsystem = "envbox"
|
||||
AgentSubsystemEnvbuilder AgentSubsystem = "envbuilder"
|
||||
AgentSubsystemExectrace AgentSubsystem = "exectrace"
|
||||
)
|
||||
|
||||
func (s AgentSubsystem) Valid() bool {
|
||||
switch s {
|
||||
case AgentSubsystemEnvbox, AgentSubsystemEnvbuilder, AgentSubsystemExectrace:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
type WorkspaceAgentLogSource string
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user