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

Skip to content

feat: Add workspace agent lifecycle state reporting #5785

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

Merged
merged 24 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
test: Update terraform tests for provider v0.6.7
  • Loading branch information
mafredri committed Jan 23, 2023
commit aaf19bcb00ee608e945d5b2f64950f0abb34531e
4 changes: 4 additions & 0 deletions provisioner/terraform/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type agentAttributes struct {
ConnectionTimeoutSeconds int32 `mapstructure:"connection_timeout"`
TroubleshootingURL string `mapstructure:"troubleshooting_url"`
MOTDFile string `mapstructure:"motd_file"`
DelayLoginUntilReady bool `mapstructure:"delay_login_until_ready"`
StartupScriptTimeout int32 `mapstructure:"startup_script_timeout"`
}

// A mapping of attributes on the "coder_app" resource.
Expand Down Expand Up @@ -132,6 +134,8 @@ func ConvertResourcesAndParameters(modules []*tfjson.StateModule, rawGraph strin
ConnectionTimeoutSeconds: attrs.ConnectionTimeoutSeconds,
TroubleshootingUrl: attrs.TroubleshootingURL,
MotdFile: attrs.MOTDFile,
DelayLoginUntilReady: attrs.DelayLoginUntilReady,
StartupScriptTimeout: attrs.StartupScriptTimeout,
}
switch attrs.Auth {
case "token":
Expand Down
9 changes: 8 additions & 1 deletion provisioner/terraform/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,26 @@ func TestConvertResources(t *testing.T) {
Architecture: "amd64",
Auth: &proto.Agent_Token{},
ConnectionTimeoutSeconds: 120,
DelayLoginUntilReady: false,
StartupScriptTimeout: 300,
}, {
Name: "dev2",
OperatingSystem: "darwin",
Architecture: "amd64",
Auth: &proto.Agent_Token{},
ConnectionTimeoutSeconds: 1,
MotdFile: "/etc/motd",
DelayLoginUntilReady: false,
StartupScriptTimeout: 30,
}, {
Name: "dev3",
OperatingSystem: "windows",
Architecture: "arm64",
Auth: &proto.Agent_Token{},
ConnectionTimeoutSeconds: 120,
TroubleshootingUrl: "https://coder.com/troubleshoot",
DelayLoginUntilReady: true,
StartupScriptTimeout: 300,
}},
}},
},
Expand Down Expand Up @@ -231,7 +237,8 @@ func TestConvertResources(t *testing.T) {
ConnectionTimeoutSeconds: 120,
}},
},
}},
},
},
"rich-parameters": {
resources: []*proto.Resource{{
Name: "dev",
Expand Down
1 change: 1 addition & 0 deletions provisioner/terraform/testdata/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ for d in */; do

# This needs care to update correctly.
if [[ $name == "kubernetes-metadata" ]]; then
popd
continue
fi

Expand Down
19 changes: 11 additions & 8 deletions provisioner/terraform/testdata/multiple-agents/multiple-agents.tf
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.4"
version = "0.6.7"
}
}
}
Expand All @@ -13,16 +13,19 @@ resource "coder_agent" "dev1" {
}

resource "coder_agent" "dev2" {
os = "darwin"
arch = "amd64"
connection_timeout = 1
motd_file = "/etc/motd"
os = "darwin"
arch = "amd64"
connection_timeout = 1
motd_file = "/etc/motd"
startup_script_timeout = 30
delay_login_until_ready = false
}

resource "coder_agent" "dev3" {
os = "windows"
arch = "arm64"
troubleshooting_url = "https://coder.com/troubleshoot"
os = "windows"
arch = "arm64"
troubleshooting_url = "https://coder.com/troubleshoot"
delay_login_until_ready = true
}

resource "null_resource" "dev" {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading