Skip to content

feat: deprecate relative_path in favor of subdomain #61

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 2 commits into from
Oct 4, 2022
Merged
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
13 changes: 7 additions & 6 deletions docs/resources/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ EOF
}

resource "coder_app" "code-server" {
agent_id = coder_agent.dev.id
name = "VS Code"
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
url = "http://localhost:13337"
relative_path = true
agent_id = coder_agent.dev.id
name = "VS Code"
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
url = "http://localhost:13337"
subdomain = false
healthcheck {
url = "http://localhost:13337/healthz"
interval = 5
Expand Down Expand Up @@ -66,7 +66,8 @@ resource "coder_app" "intellij" {
- `healthcheck` (Block Set, Max: 1) HTTP health checking to determine the application readiness. (see [below for nested schema](#nestedblock--healthcheck))
- `icon` (String) A URL to an icon that will display in the dashboard. View built-in icons here: https://github.com/coder/coder/tree/main/site/static/icons. Use a built-in icon with `data.coder_workspace.me.access_url + "/icons/<path>"`.
- `name` (String) A display name to identify the app.
- `relative_path` (Boolean) Specifies whether the URL will be accessed via a relative path or wildcard. Use if wildcard routing is unavailable.
- `relative_path` (Boolean, Deprecated) Specifies whether the URL will be accessed via a relative path or wildcard. Use if wildcard routing is unavailable. Defaults to true.
- `subdomain` (Boolean) Determines whether the app will be accessed via it's own subdomain or whether it will be accessed via a path on Coder. If wildcards have not been setup by the administrator then apps with "subdomain" set to true will not be accessible. Defaults to false.
- `url` (String) A URL to be proxied to from inside the workspace. Either "command" or "url" may be specified, but not both.

### Read-Only
Expand Down
10 changes: 5 additions & 5 deletions examples/resources/coder_app/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ EOF
}

resource "coder_app" "code-server" {
agent_id = coder_agent.dev.id
name = "VS Code"
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
url = "http://localhost:13337"
relative_path = true
agent_id = coder_agent.dev.id
name = "VS Code"
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
url = "http://localhost:13337"
subdomain = false
healthcheck {
url = "http://localhost:13337/healthz"
interval = 5
Expand Down
19 changes: 14 additions & 5 deletions provider/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,21 @@ func appResource() *schema.Resource {
Optional: true,
},
"relative_path": {
Type: schema.TypeBool,
Type: schema.TypeBool,
Deprecated: "`relative_path` on apps is deprecated, use `subdomain` instead.",
Description: "Specifies whether the URL will be accessed via a relative " +
"path or wildcard. Use if wildcard routing is unavailable.",
ForceNew: true,
Optional: true,
ConflictsWith: []string{"command"},
"path or wildcard. Use if wildcard routing is unavailable. Defaults to true.",
ForceNew: true,
Optional: true,
},
"subdomain": {
Type: schema.TypeBool,
Description: "Determines whether the app will be accessed via it's own " +
"subdomain or whether it will be accessed via a path on Coder. If " +
"wildcards have not been setup by the administrator then apps with " +
"\"subdomain\" set to true will not be accessible. Defaults to false.",
ForceNew: true,
Optional: true,
},
"url": {
Type: schema.TypeString,
Expand Down
4 changes: 2 additions & 2 deletions provider/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestApp(t *testing.T) {
agent_id = coder_agent.dev.id
name = "code-server"
icon = "builtin:vim"
relative_path = true
subdomain = false
url = "http://localhost:13337"
healthcheck {
url = "http://localhost:13337/healthz"
Expand All @@ -47,7 +47,7 @@ func TestApp(t *testing.T) {
"agent_id",
"name",
"icon",
"relative_path",
"subdomain",
"url",
"healthcheck.0.url",
"healthcheck.0.interval",
Expand Down