Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5455c58

Browse files
mtojekmafredri
authored andcommitted
WIP
1 parent 1483b42 commit 5455c58

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

provisioner/terraform/resources.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type agentAttributes struct {
2929
MOTDFile string `mapstructure:"motd_file"`
3030
LoginBeforeReady bool `mapstructure:"login_before_ready"`
3131
StartupScriptTimeoutSeconds int32 `mapstructure:"startup_script_timeout"`
32+
ShutdownScript string `mapstructure:"shutdown_script"`
3233
}
3334

3435
// A mapping of attributes on the "coder_app" resource.
@@ -151,6 +152,7 @@ func ConvertState(modules []*tfjson.StateModule, rawGraph string) (*State, error
151152
MotdFile: attrs.MOTDFile,
152153
LoginBeforeReady: loginBeforeReady,
153154
StartupScriptTimeoutSeconds: attrs.StartupScriptTimeoutSeconds,
155+
ShutdownScript: attrs.ShutdownScript,
154156
}
155157
switch attrs.Auth {
156158
case "token":

provisioner/terraform/resources_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ func TestConvertResources(t *testing.T) {
121121
MotdFile: "/etc/motd",
122122
LoginBeforeReady: true,
123123
StartupScriptTimeoutSeconds: 30,
124+
ShutdownScript: "echo bye bye",
124125
}, {
125126
Name: "dev3",
126127
OperatingSystem: "windows",

provisioner/terraform/testdata/multiple-agents/multiple-agents.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ resource "coder_agent" "dev2" {
1919
motd_file = "/etc/motd"
2020
startup_script_timeout = 30
2121
login_before_ready = true
22+
shutdown_script = "echo bye bye"
2223
}
2324

2425
resource "coder_agent" "dev3" {

provisionersdk/proto/provisioner.pb.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

provisionersdk/proto/provisioner.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ message Agent {
142142
string motd_file = 13;
143143
bool login_before_ready = 14;
144144
int32 startup_script_timeout_seconds = 15;
145+
string shutdown_script = 16;
145146
}
146147

147148
enum AppSharingLevel {

0 commit comments

Comments
 (0)