Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion docs/resources/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 1 addition & 3 deletions provider/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we not deciding that this no undeprecated and will not be removed?

ValidateFunc: helpers.WarnDirNotHome,
},

Expand Down
5 changes: 2 additions & 3 deletions provider/helpers/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ 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 == "~" {
return nil, nil
}
return []string{
`"dir" is deprecated and will be removed in a future release.`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here are we not undeprecating this?
With the current chnage it looks like we are only chnaging the wording but provider wll still show a warning.

`Setting "dir" to a value other than $HOME will break Coder Desktop file sync.`,
}, nil
}

Expand Down
6 changes: 3 additions & 3 deletions provider/helpers/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}

Expand Down
Loading