Skip to content

Commit 7a00ae7

Browse files
authored
feat: Add order to coder_app (#190)
1 parent e9d67f9 commit 7a00ae7

File tree

6 files changed

+15
-2
lines changed

6 files changed

+15
-2
lines changed

Diff for: docs/resources/agent.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ resource "coder_agent" "dev" {
4343
timeout = 1
4444
order = 1
4545
}
46+
47+
order = 1
4648
}
4749
4850
resource "kubernetes_pod" "dev" {
@@ -114,5 +116,5 @@ Required:
114116
Optional:
115117

116118
- `display_name` (String) The user-facing name of this value.
117-
- `order` (Number) The order determines the position of agent metadata in the UI/CLI presentation. The lowest order is shown first and parameters with equal order are sorted by key (ascending order).
119+
- `order` (Number) The order determines the position of agent metadata in the UI presentation. The lowest order is shown first and metadata with equal order are sorted by key (ascending order).
118120
- `timeout` (Number) The maximum time the command is allowed to run in seconds.

Diff for: docs/resources/app.md

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ resource "coder_app" "intellij" {
7373
- `healthcheck` (Block Set, Max: 1) HTTP health checking to determine the application readiness. (see [below for nested schema](#nestedblock--healthcheck))
7474
- `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/icon. Use a built-in icon with `data.coder_workspace.me.access_url + "/icon/<path>"`.
7575
- `name` (String, Deprecated) A display name to identify the app.
76+
- `order` (Number) The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order).
7677
- `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.
7778
- `share` (String) Determines the "level" which the application is shared at. Valid levels are "owner" (default), "authenticated" and "public". Level "owner" disables sharing on the app, so only the workspace owner can access it. Level "authenticated" shares the app with all authenticated users. Level "public" shares it with any user, including unauthenticated users. Permitted application sharing levels can be configured site-wide via a flag on `coder server` (Enterprise only).
7879
- `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.

Diff for: examples/resources/coder_agent/resource.tf

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ resource "coder_agent" "dev" {
2828
timeout = 1
2929
order = 1
3030
}
31+
32+
order = 1
3133
}
3234

3335
resource "kubernetes_pod" "dev" {

Diff for: provider/agent.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func agentResource() *schema.Resource {
243243
},
244244
"order": {
245245
Type: schema.TypeInt,
246-
Description: "The order determines the position of agent metadata in the UI/CLI presentation. The lowest order is shown first and parameters with equal order are sorted by key (ascending order).",
246+
Description: "The order determines the position of agent metadata in the UI presentation. The lowest order is shown first and metadata with equal order are sorted by key (ascending order).",
247247
ForceNew: true,
248248
Optional: true,
249249
},

Diff for: provider/app.go

+6
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ func appResource() *schema.Resource {
196196
},
197197
},
198198
},
199+
"order": {
200+
Type: schema.TypeInt,
201+
Description: "The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order).",
202+
ForceNew: true,
203+
Optional: true,
204+
},
199205
},
200206
}
201207
}

Diff for: provider/app_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func TestApp(t *testing.T) {
4444
interval = 5
4545
threshold = 6
4646
}
47+
order = 4
4748
}
4849
`,
4950
Check: func(state *terraform.State) error {
@@ -64,6 +65,7 @@ func TestApp(t *testing.T) {
6465
"healthcheck.0.url",
6566
"healthcheck.0.interval",
6667
"healthcheck.0.threshold",
68+
"order",
6769
} {
6870
value := resource.Primary.Attributes[key]
6971
t.Logf("%q = %q", key, value)

0 commit comments

Comments
 (0)