Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add order to coder_parameter#134

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 5 commits intocoder:mainfrommtojek:8193-priority-ui
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes fromall 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
2 changes: 0 additions & 2 deletionsdocs/data-sources/git_auth.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,5 +46,3 @@ EOF
###Read-Only

-`access_token` (String) The access token returned by the git authentication provider. This can be used to pre-authenticate command-line tools.


3 changes: 1 addition & 2 deletionsdocs/data-sources/parameter.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,6 +29,7 @@ Use this data source to configure editable options for workspaces.
- `legacy_variable_name` (String, Deprecated) Name of the legacy Terraform variable. Coder will use it to lookup the variable value.
- `mutable` (Boolean) Whether this value can be changed after workspace creation. This can be destructive for values like region, so use with caution!
- `option` (Block List, Max: 64) Each "option" block defines a value for a user to select from. (see [below for nested schema](#nestedblock--option))
- `order` (Number) The order determines the position of a template parameter in the UI/CLI presentation. The lowest order is shown first and parameters with equal order are sorted by name (ascending order).
- `type` (String) The type of this parameter. Must be one of: "number", "string", "bool", or "list(string)".
- `validation` (Block List, Max: 1) Validate the input of a parameter. (see [below for nested schema](#nestedblock--validation))

Expand DownExpand Up@@ -67,5 +68,3 @@ Read-Only:

- `max_disabled` (Boolean) Helper field to check if max is present
- `min_disabled` (Boolean) Helper field to check if min is present


2 changes: 0 additions & 2 deletionsdocs/data-sources/provisioner.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,5 +20,3 @@ Use this data source to get information about the Coder provisioner.
- `arch` (String) The architecture of the host. This exposes `runtime.GOARCH` (see https://pkg.go.dev/runtime#pkg-constants).
- `id` (String) The ID of this resource.
- `os` (String) The operating system of the host. This exposes `runtime.GOOS` (see https://pkg.go.dev/runtime#pkg-constants).


2 changes: 0 additions & 2 deletionsdocs/data-sources/workspace.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,5 +37,3 @@ resource "kubernetes_pod" "dev" {
-`owner_session_token` (String) Session token for interfacing with a Coder deployment. It is regenerated everytime a workspace is started.
-`start_count` (Number) A computed count based on "transition" state. If "start", count will equal 1.
-`transition` (String) Either "start" or "stop". Use this to start/stop resources with "count".


2 changes: 0 additions & 2 deletionsdocs/resources/agent.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,5 +79,3 @@ Optional:

-`display_name` (String) The user-facing name of this value.
-`timeout` (Number) The maximum time the command is allowed to run in seconds.


2 changes: 0 additions & 2 deletionsdocs/resources/agent_instance.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,5 +40,3 @@ resource "coder_agent_instance" "dev" {
###Read-Only

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


2 changes: 0 additions & 2 deletionsdocs/resources/app.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,5 +90,3 @@ Required:
-`interval` (Number) Duration in seconds to wait between healthcheck requests.
-`threshold` (Number) Number of consecutive heathcheck failures before returning an unhealthy status.
-`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.


2 changes: 0 additions & 2 deletionsdocs/resources/metadata.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -80,5 +80,3 @@ Optional:
Read-Only:

-`is_null` (Boolean)


2 changes: 2 additions & 0 deletionsexamples/resources/coder_parameter/resource.tf
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,12 +45,14 @@ data "coder_parameter" "cores" {
type = "number"
icon = "/icon/cpu.svg"
default = 3
order = 10
}

data "coder_parameter" "disk_size" {
name = "Disk Size"
type = "number"
default = "5"
order = 8
validation {
# This can apply to number.
min = 0
Expand Down
9 changes: 9 additions & 0 deletionsprovider/parameter.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,6 +57,8 @@ type Parameter struct {
Validation []Validation
Optional bool

Order int

LegacyVariableName string `mapstructure:"legacy_variable_name"`
LegacyVariable string `mapstructure:"legacy_variable"`
}
Expand DownExpand Up@@ -90,6 +92,7 @@ func parameterDataSource() *schema.Resource {
Option interface{}
Validation interface{}
Optional interface{}
Order interface{}

LegacyVariableName interface{}
LegacyVariable interface{}
Expand DownExpand Up@@ -122,6 +125,7 @@ func parameterDataSource() *schema.Resource {
rd.Set("optional", val)
return val
}(),
Order: rd.Get("order"),
LegacyVariableName: rd.Get("legacy_variable_name"),
LegacyVariable: rd.Get("legacy_variable"),
}, &parameter)
Expand DownExpand Up@@ -331,6 +335,11 @@ func parameterDataSource() *schema.Resource {
Computed: true,
Description: "Whether this value is optional.",
},
"order": {
Type: schema.TypeInt,
Optional: true,
Description: "The order determines the position of a template parameter in the UI/CLI presentation. The lowest order is shown first and parameters with equal order are sorted by name (ascending order).",
},
"legacy_variable_name": {
Type: schema.TypeString,
Optional: true,
Expand Down
2 changes: 2 additions & 0 deletionsprovider/parameter_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,6 +43,7 @@ func TestParameter(t *testing.T) {
icon = "/icon/east.svg"
description = "Select for east!"
}
order = 5
}
`,
Check: func(state *terraform.ResourceState) {
Expand All@@ -62,6 +63,7 @@ func TestParameter(t *testing.T) {
"option.1.value": "us-east1-a",
"option.1.icon": "/icon/east.svg",
"option.1.description": "Select for east!",
"order": "5",
} {
require.Equal(t, value, attrs[key])
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp