Skip to content

Commit

Permalink
feat: deprecate relative_path in favor of subdomain (#61)
Browse files Browse the repository at this point in the history
* feat: deprecate relative_path in favor of subdomain

* fixup! feat: deprecate relative_path in favor of subdomain
  • Loading branch information
deansheather authored Oct 4, 2022
1 parent b6d7077 commit dfd2dd0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
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

0 comments on commit dfd2dd0

Please sign in to comment.