diff --git a/docs/resources/agent.md b/docs/resources/agent.md index d12146c2..fdba1883 100644 --- a/docs/resources/agent.md +++ b/docs/resources/agent.md @@ -77,7 +77,7 @@ resource "kubernetes_pod" "dev" { - `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. - `dir` (String, Deprecated) The starting directory when a user creates a shell session. Defaults to `"$HOME"`. -~> **Warning:** This attribute is deprecated and will be removed in a future release. Setting `dir` to a value other than `$HOME` will break [Coder Desktop file sync](https://coder.com/docs/user-guides/desktop/desktop-connect-sync). +~> **Warning:** This attribute is deprecated and will be removed in a future release. - `display_apps` (Block Set, Max: 1) The list of built-in apps to display in the agent bar. (see [below for nested schema](#nestedblock--display_apps)) - `env` (Map of String) A mapping of environment variables to set inside the workspace. - `metadata` (Block List) Each `metadata` block defines a single item consisting of a key/value pair. This feature is in alpha and may break in future releases. (see [below for nested schema](#nestedblock--metadata)) diff --git a/provider/agent.go b/provider/agent.go index dc662e4a..356912fd 100644 --- a/provider/agent.go +++ b/provider/agent.go @@ -118,9 +118,7 @@ func agentResource() *schema.Resource { Optional: true, Deprecated: "dir has been deprecated and will be removed in a future release.", Description: "The starting directory when a user creates a shell session. Defaults to `\"$HOME\"`." + - "\n\n~> **Warning:** This attribute is deprecated and will be removed in a future release. " + - "Setting `dir` to a value other than `$HOME` will break " + - "[Coder Desktop file sync](https://coder.com/docs/user-guides/desktop/desktop-connect-sync).", + "\n\n~> **Warning:** This attribute is deprecated and will be removed in a future release.", ValidateFunc: helpers.WarnDirNotHome, }, diff --git a/provider/helpers/validation.go b/provider/helpers/validation.go index 0167877a..ce13257e 100644 --- a/provider/helpers/validation.go +++ b/provider/helpers/validation.go @@ -22,8 +22,8 @@ func ValidateURL(value any, label string) ([]string, []error) { } // WarnDirNotHome returns a warning if dir is set to a value other -// than $HOME, because this breaks Coder Desktop file sync. The dir -// attribute is deprecated and will be removed in a future release. +// than $HOME. The dir attribute is deprecated and will be removed in +// a future release. func WarnDirNotHome(val interface{}, _ string) ([]string, []error) { d, ok := val.(string) if !ok || d == "" || d == "$HOME" || d == "~" { @@ -31,7 +31,6 @@ func WarnDirNotHome(val interface{}, _ string) ([]string, []error) { } return []string{ `"dir" is deprecated and will be removed in a future release.`, - `Setting "dir" to a value other than $HOME will break Coder Desktop file sync.`, }, nil } diff --git a/provider/helpers/validation_test.go b/provider/helpers/validation_test.go index 41ac35e1..79208fbc 100644 --- a/provider/helpers/validation_test.go +++ b/provider/helpers/validation_test.go @@ -181,17 +181,17 @@ func TestWarnDirNotHome(t *testing.T) { { name: "absolute path", value: "/workspace", - warnCount: 2, + warnCount: 1, }, { name: "relative path", value: "projects/foo", - warnCount: 2, + warnCount: 1, }, { name: "tilde subdir", value: "~/projects", - warnCount: 2, + warnCount: 1, }, }