Skip to content

feat: Add support for shutdown_script #5171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into 4677-shutdown-script
  • Loading branch information
mtojek committed Nov 25, 2022
commit 0144b7781f7aeead2d23e55ea3f6897a14391d03
2 changes: 2 additions & 0 deletions provisioner/terraform/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type agentAttributes struct {
StartupScript string `mapstructure:"startup_script"`
ConnectionTimeoutSeconds int32 `mapstructure:"connection_timeout"`
TroubleshootingURL string `mapstructure:"troubleshooting_url"`
MOTDFile string `mapstructure:"motd_file"`
ShutdownScript string `mapstructure:"shutdown_script"`
}

Expand Down Expand Up @@ -131,6 +132,7 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res
Directory: attrs.Directory,
ConnectionTimeoutSeconds: attrs.ConnectionTimeoutSeconds,
TroubleshootingUrl: attrs.TroubleshootingURL,
MotdFile: attrs.MOTDFile,
ShutdownScript: attrs.ShutdownScript,
}
switch attrs.Auth {
Expand Down
1 change: 1 addition & 0 deletions provisioner/terraform/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func TestConvertResources(t *testing.T) {
Architecture: "amd64",
Auth: &proto.Agent_Token{},
ConnectionTimeoutSeconds: 1,
MotdFile: "/etc/motd",
ShutdownScript: "echo bye bye",
}, {
Name: "dev3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
coder = {
source = "coder/coder"
version = "0.6.5"
version = "0.6.4"
}
}
}
Expand All @@ -16,6 +16,7 @@ resource "coder_agent" "dev2" {
os = "darwin"
arch = "amd64"
connection_timeout = 1
motd_file = "/etc/motd"
shutdown_script = "echo bye bye"
}

Expand Down
3 changes: 2 additions & 1 deletion provisionersdk/proto/provisioner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ message Agent {
}
int32 connection_timeout_seconds = 11;
string troubleshooting_url = 12;
string shutdown_script = 13;
string motd_file = 13;
string shutdown_script = 14;
}

enum AppSharingLevel {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.