Skip to content

Commit a21f085

Browse files
committed
Fix non-blocking by default in agent
1 parent 139bbf9 commit a21f085

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

coderd/workspaceagents.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,7 @@ func convertWorkspaceAgent(derpMap *tailcfg.DERPMap, coordinator tailnet.Coordin
14651465
Architecture: dbAgent.Architecture,
14661466
OperatingSystem: dbAgent.OperatingSystem,
14671467
Scripts: scripts,
1468+
StartupScriptBehavior: codersdk.WorkspaceAgentStartupScriptBehaviorNonBlocking,
14681469
LogsLength: dbAgent.LogsLength,
14691470
LogsOverflowed: dbAgent.LogsOverflowed,
14701471
LogSources: logSources,

codersdk/workspaceagents.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ var WorkspaceAgentLifecycleOrder = []WorkspaceAgentLifecycle{
101101
// ready (can be overridden).
102102
//
103103
// Presently, non-blocking is the default, but this may change in the future.
104+
// Deprecated: `coder_script` allows configuration on a per-script basis.
104105
type WorkspaceAgentStartupScriptBehavior string
105106

106107
const (
@@ -175,6 +176,11 @@ type WorkspaceAgent struct {
175176
DisplayApps []DisplayApp `json:"display_apps"`
176177
LogSources []WorkspaceAgentLogSource `json:"log_sources"`
177178
Scripts []WorkspaceAgentScript `json:"scripts"`
179+
180+
// StartupScriptBehavior is a legacy field that is deprecated in favor
181+
// of the `coder_script` resource. It's only referenced by old clients.
182+
// Deprecated: Remove in the future!
183+
StartupScriptBehavior WorkspaceAgentStartupScriptBehavior `json:"startup_script_behavior"`
178184
}
179185

180186
type WorkspaceAgentLogSource struct {

provisioner/terraform/resources.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ func ConvertState(modules []*tfjson.StateModule, rawGraph string) (*State, error
234234
// Support the legacy script attributes in the agent!
235235
if attrs.StartupScript != "" {
236236
agent.Scripts = append(agent.Scripts, &proto.Script{
237+
// This is ▶️
238+
Icon: "/emojis/25b6.png",
237239
LogPath: "coder-startup-script.log",
238240
DisplayName: "Startup Script",
239241
Script: attrs.StartupScript,
@@ -243,6 +245,8 @@ func ConvertState(modules []*tfjson.StateModule, rawGraph string) (*State, error
243245
}
244246
if attrs.ShutdownScript != "" {
245247
agent.Scripts = append(agent.Scripts, &proto.Script{
248+
// This is ◀️
249+
Icon: "/emojis/25c0.png",
246250
LogPath: "coder-shutdown-script.log",
247251
DisplayName: "Shutdown Script",
248252
Script: attrs.ShutdownScript,

0 commit comments

Comments
 (0)