Skip to content

Commit 830a7ca

Browse files
authored
fix: Improve connection_timeout docs and add validation (coder#72)
1 parent e7a2598 commit 830a7ca

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

docs/resources/agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ resource "kubernetes_pod" "dev" {
4747
### Optional
4848

4949
- `auth` (String) The authentication type the agent will use. Must be one of: "token", "google-instance-identity", "aws-instance-identity", "azure-instance-identity".
50-
- `connection_timeout` (Number) Time in seconds until the agent is marked as timed out when a connection with the server cannot be established.
50+
- `connection_timeout` (Number) Time in seconds until the agent is marked as timed out when a connection with the server cannot be established. A value of zero never marks the agent as timed out.
5151
- `dir` (String) The starting directory when a user creates a shell session. Defaults to $HOME.
5252
- `env` (Map of String) A mapping of environment variables to set inside the workspace.
5353
- `motd_file` (String) The path to a file within the workspace containing a message to display to users when they login via SSH. A typical value would be /etc/motd.

provider/agent.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ func agentResource() *schema.Resource {
8989
Computed: true,
9090
},
9191
"connection_timeout": {
92-
Type: schema.TypeInt,
93-
Default: 120,
94-
ForceNew: true,
95-
Optional: true,
96-
Description: "Time in seconds until the agent is marked as timed out when a connection with the server cannot be established.",
92+
Type: schema.TypeInt,
93+
Default: 120,
94+
ForceNew: true,
95+
Optional: true,
96+
Description: "Time in seconds until the agent is marked as timed out when a connection with the server cannot be established. A value of zero never marks the agent as timed out.",
97+
ValidateFunc: validation.IntAtLeast(0),
9798
},
9899
"troubleshooting_url": {
99100
Type: schema.TypeString,

0 commit comments

Comments
 (0)