mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
refactor: deprecate login_before_ready in favor of startup_script_behavior (#7837)
Fixes #7758
This commit is contained in:
@@ -76,6 +76,20 @@ var WorkspaceAgentLifecycleOrder = []WorkspaceAgentLifecycle{
|
||||
WorkspaceAgentLifecycleOff,
|
||||
}
|
||||
|
||||
// WorkspaceAgentStartupScriptBehavior defines whether or not the startup script
|
||||
// should be considered blocking or non-blocking. The blocking behavior means
|
||||
// that the agent will not be considered ready until the startup script has
|
||||
// completed and, for example, SSH connections will wait for the agent to be
|
||||
// ready (can be overridden).
|
||||
//
|
||||
// Presently, non-blocking is the default, but this may change in the future.
|
||||
type WorkspaceAgentStartupScriptBehavior string
|
||||
|
||||
const (
|
||||
WorkspaceAgentStartupScriptBehaviorBlocking WorkspaceAgentStartupScriptBehavior = "blocking"
|
||||
WorkspaceAgentStartupScriptBehaviorNonBlocking WorkspaceAgentStartupScriptBehavior = "non-blocking"
|
||||
)
|
||||
|
||||
type WorkspaceAgentMetadataResult struct {
|
||||
CollectedAt time.Time `json:"collected_at" format:"date-time"`
|
||||
// Age is the number of seconds since the metadata was collected.
|
||||
@@ -127,8 +141,9 @@ type WorkspaceAgent struct {
|
||||
DERPLatency map[string]DERPRegion `json:"latency,omitempty"`
|
||||
ConnectionTimeoutSeconds int32 `json:"connection_timeout_seconds"`
|
||||
TroubleshootingURL string `json:"troubleshooting_url"`
|
||||
// LoginBeforeReady if true, the agent will delay logins until it is ready (e.g. executing startup script has ended).
|
||||
LoginBeforeReady bool `json:"login_before_ready"`
|
||||
// Deprecated: Use StartupScriptBehavior instead.
|
||||
LoginBeforeReady bool `json:"login_before_ready"`
|
||||
StartupScriptBehavior WorkspaceAgentStartupScriptBehavior `json:"startup_script_behavior"`
|
||||
// StartupScriptTimeoutSeconds is the number of seconds to wait for the startup script to complete. If the script does not complete within this time, the agent lifecycle will be marked as start_timeout.
|
||||
StartupScriptTimeoutSeconds int32 `json:"startup_script_timeout_seconds"`
|
||||
ShutdownScript string `json:"shutdown_script,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user