Skip to content

feat: Add order to coder_app #190

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 1 commit into from
Feb 9, 2024
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
4 changes: 3 additions & 1 deletion docs/resources/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ resource "coder_agent" "dev" {
timeout = 1
order = 1
}

order = 1
}

resource "kubernetes_pod" "dev" {
Expand Down Expand Up @@ -114,5 +116,5 @@ Required:
Optional:

- `display_name` (String) The user-facing name of this value.
- `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).
- `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).
- `timeout` (Number) The maximum time the command is allowed to run in seconds.
1 change: 1 addition & 0 deletions docs/resources/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ 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/icon. Use a built-in icon with `data.coder_workspace.me.access_url + "/icon/<path>"`.
- `name` (String, Deprecated) A display name to identify the app.
- `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).
- `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.
- `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).
- `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.
Expand Down
2 changes: 2 additions & 0 deletions examples/resources/coder_agent/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ resource "coder_agent" "dev" {
timeout = 1
order = 1
}

order = 1
}

resource "kubernetes_pod" "dev" {
Expand Down
2 changes: 1 addition & 1 deletion provider/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func agentResource() *schema.Resource {
},
"order": {
Type: schema.TypeInt,
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).",
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).",
ForceNew: true,
Optional: true,
},
Expand Down
6 changes: 6 additions & 0 deletions provider/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ func appResource() *schema.Resource {
},
},
},
"order": {
Type: schema.TypeInt,
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).",
ForceNew: true,
Optional: true,
},
},
}
}
2 changes: 2 additions & 0 deletions provider/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func TestApp(t *testing.T) {
interval = 5
threshold = 6
}
order = 4
}
`,
Check: func(state *terraform.State) error {
Expand All @@ -64,6 +65,7 @@ func TestApp(t *testing.T) {
"healthcheck.0.url",
"healthcheck.0.interval",
"healthcheck.0.threshold",
"order",
} {
value := resource.Primary.Attributes[key]
t.Logf("%q = %q", key, value)
Expand Down