Skip to content

Commit be86e26

Browse files
mtojekmafredri
authored andcommitted
More code
1 parent f9a02f0 commit be86e26

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

coderd/provisionerdserver/provisionerdserver_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ func TestInsertWorkspaceResource(t *testing.T) {
772772
Apps: []*sdkproto.App{{
773773
Slug: "a",
774774
}},
775+
ShutdownScript: "shutdown",
775776
}},
776777
})
777778
require.NoError(t, err)
@@ -786,6 +787,7 @@ func TestInsertWorkspaceResource(t *testing.T) {
786787
require.Equal(t, "amd64", agent.Architecture)
787788
require.Equal(t, "linux", agent.OperatingSystem)
788789
require.Equal(t, "value", agent.StartupScript.String)
790+
require.Equal(t, "shutdown", agent.ShutdownScript.String)
789791
want, err := json.Marshal(map[string]string{
790792
"something": "test",
791793
})

coderd/telemetry/telemetry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ func ConvertWorkspaceAgent(agent database.WorkspaceAgent) WorkspaceAgent {
550550
StartupScript: agent.StartupScript.Valid,
551551
Directory: agent.Directory != "",
552552
ConnectionTimeoutSeconds: agent.ConnectionTimeoutSeconds,
553+
ShutdownScript: agent.ShutdownScript.Valid,
553554
}
554555
if agent.FirstConnectedAt.Valid {
555556
snapAgent.FirstConnectedAt = &agent.FirstConnectedAt.Time
@@ -750,6 +751,7 @@ type WorkspaceAgent struct {
750751
LastConnectedAt *time.Time `json:"last_connected_at"`
751752
DisconnectedAt *time.Time `json:"disconnected_at"`
752753
ConnectionTimeoutSeconds int32 `json:"connection_timeout_seconds"`
754+
ShutdownScript bool `json:"shutdown_script"`
753755
}
754756

755757
type WorkspaceApp struct {

coderd/workspaceagents.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ func convertWorkspaceAgent(derpMap *tailcfg.DERPMap, coordinator tailnet.Coordin
799799
LifecycleState: codersdk.WorkspaceAgentLifecycle(dbAgent.LifecycleState),
800800
LoginBeforeReady: dbAgent.LoginBeforeReady,
801801
StartupScriptTimeoutSeconds: dbAgent.StartupScriptTimeoutSeconds,
802+
ShutdownScript: dbAgent.ShutdownScript.String,
802803
}
803804
node := coordinator.Node(dbAgent.ID)
804805
if node != nil {

0 commit comments

Comments
 (0)