Skip to content

Commit dfd88cb

Browse files
committed
feat: deprecate relative_path in favor of subdomain
1 parent b6d7077 commit dfd88cb

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

docs/resources/app.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ resource "coder_app" "code-server" {
3030
name = "VS Code"
3131
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
3232
url = "http://localhost:13337"
33-
relative_path = true
33+
subdomain = false
3434
healthcheck {
3535
url = "http://localhost:13337/healthz"
3636
interval = 5
@@ -54,6 +54,7 @@ resource "coder_app" "intellij" {
5454
```
5555

5656
<!-- schema generated by tfplugindocs -->
57+
5758
## Schema
5859

5960
### Required
@@ -66,20 +67,19 @@ resource "coder_app" "intellij" {
6667
- `healthcheck` (Block Set, Max: 1) HTTP health checking to determine the application readiness. (see [below for nested schema](#nestedblock--healthcheck))
6768
- `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>"`.
6869
- `name` (String) A display name to identify the app.
69-
- `relative_path` (Boolean) Specifies whether the URL will be accessed via a relative path or wildcard. Use if wildcard routing is unavailable.
70+
- `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.
7071
- `url` (String) A URL to be proxied to from inside the workspace. Either "command" or "url" may be specified, but not both.
7172

7273
### Read-Only
7374

7475
- `id` (String) The ID of this resource.
7576

7677
<a id="nestedblock--healthcheck"></a>
78+
7779
### Nested Schema for `healthcheck`
7880

7981
Required:
8082

8183
- `interval` (Number) Duration in seconds to wait between healthcheck requests.
8284
- `threshold` (Number) Number of consecutive heathcheck failures before returning an unhealthy status.
8385
- `url` (String) HTTP address used determine the application readiness. A successful health check is a HTTP response code less than 500 returned before healthcheck.interval seconds.
84-
85-

examples/resources/coder_app/resource.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ EOF
1111
}
1212

1313
resource "coder_app" "code-server" {
14-
agent_id = coder_agent.dev.id
15-
name = "VS Code"
16-
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
17-
url = "http://localhost:13337"
18-
relative_path = true
14+
agent_id = coder_agent.dev.id
15+
name = "VS Code"
16+
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
17+
url = "http://localhost:13337"
18+
subdomain = false
1919
healthcheck {
2020
url = "http://localhost:13337/healthz"
2121
interval = 5

provider/app.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,21 @@ func appResource() *schema.Resource {
6060
Optional: true,
6161
},
6262
"relative_path": {
63-
Type: schema.TypeBool,
63+
Type: schema.TypeBool,
64+
Deprecated: "`relative_path` on apps is deprecated, use `subdomain` instead.",
6465
Description: "Specifies whether the URL will be accessed via a relative " +
65-
"path or wildcard. Use if wildcard routing is unavailable.",
66-
ForceNew: true,
67-
Optional: true,
68-
ConflictsWith: []string{"command"},
66+
"path or wildcard. Use if wildcard routing is unavailable. Defaults to true.",
67+
ForceNew: true,
68+
Optional: true,
69+
},
70+
"subdomain": {
71+
Type: schema.TypeBool,
72+
Description: "Determines whether the app will be accessed via it's own " +
73+
"subdomain or whether it will be accessed via a path on Coder. If " +
74+
"wildcards have not been setup by the administrator then apps with " +
75+
"\"subdomain\" set to true will not be accessible. Defaults to false.",
76+
ForceNew: true,
77+
Optional: true,
6978
},
7079
"url": {
7180
Type: schema.TypeString,

provider/app_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestApp(t *testing.T) {
2929
agent_id = coder_agent.dev.id
3030
name = "code-server"
3131
icon = "builtin:vim"
32-
relative_path = true
32+
subdomain = false
3333
url = "http://localhost:13337"
3434
healthcheck {
3535
url = "http://localhost:13337/healthz"
@@ -47,7 +47,7 @@ func TestApp(t *testing.T) {
4747
"agent_id",
4848
"name",
4949
"icon",
50-
"relative_path",
50+
"subdomain",
5151
"url",
5252
"healthcheck.0.url",
5353
"healthcheck.0.interval",

0 commit comments

Comments
 (0)