Skip to content

Commit 110b10b

Browse files
committed
Pass through providerd
1 parent d304f8b commit 110b10b

File tree

14 files changed

+292
-260
lines changed

14 files changed

+292
-260
lines changed

coderd/apidoc/docs.go

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbfake/databasefake.go

+1
Original file line numberDiff line numberDiff line change
@@ -2696,6 +2696,7 @@ func (q *fakeQuerier) InsertTemplateVersionParameter(_ context.Context, arg data
26962696
ValidationMin: arg.ValidationMin,
26972697
ValidationMax: arg.ValidationMax,
26982698
ValidationMonotonic: arg.ValidationMonotonic,
2699+
Required: arg.Required,
26992700
}
27002701
q.templateVersionParameters = append(q.templateVersionParameters, param)
27012702
return param, nil

coderd/database/queries.sql.go

+6-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/templateversionparameters.sql

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ INSERT INTO
1313
validation_min,
1414
validation_max,
1515
validation_error,
16-
validation_monotonic
16+
validation_monotonic,
17+
required
1718
)
1819
VALUES
1920
(
@@ -29,7 +30,8 @@ VALUES
2930
$10,
3031
$11,
3132
$12,
32-
$13
33+
$13,
34+
$14
3335
) RETURNING *;
3436

3537
-- name: GetTemplateVersionParameters :many

coderd/templateversions.go

+1
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,7 @@ func convertTemplateVersionParameter(param database.TemplateVersionParameter) (c
16211621
ValidationMax: param.ValidationMax,
16221622
ValidationError: param.ValidationError,
16231623
ValidationMonotonic: codersdk.ValidationMonotonicOrder(param.ValidationMonotonic),
1624+
Required: param.Required,
16241625
}, nil
16251626
}
16261627

codersdk/templateversions.go

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ type TemplateVersionParameter struct {
5353
ValidationMin int32 `json:"validation_min,omitempty"`
5454
ValidationMax int32 `json:"validation_max,omitempty"`
5555
ValidationMonotonic ValidationMonotonicOrder `json:"validation_monotonic,omitempty" enums:"increasing,decreasing"`
56+
Required bool `json:"required"`
5657
}
5758

5859
// TemplateVersionParameterOption represents a selectable option for a template parameter.

docs/api/schemas.md

+2
Original file line numberDiff line numberDiff line change
@@ -4838,6 +4838,7 @@ Parameter represents a set value for the scope.
48384838
"value": "string"
48394839
}
48404840
],
4841+
"required": true,
48414842
"type": "string",
48424843
"validation_error": "string",
48434844
"validation_max": 0,
@@ -4858,6 +4859,7 @@ Parameter represents a set value for the scope.
48584859
| `mutable` | boolean | false | | |
48594860
| `name` | string | false | | |
48604861
| `options` | array of [codersdk.TemplateVersionParameterOption](#codersdktemplateversionparameteroption) | false | | |
4862+
| `required` | boolean | false | | |
48614863
| `type` | string | false | | |
48624864
| `validation_error` | string | false | | |
48634865
| `validation_max` | integer | false | | |

docs/api/templates.md

+2
Original file line numberDiff line numberDiff line change
@@ -2182,6 +2182,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r
21822182
"value": "string"
21832183
}
21842184
],
2185+
"required": true,
21852186
"type": "string",
21862187
"validation_error": "string",
21872188
"validation_max": 0,
@@ -2216,6 +2217,7 @@ Status Code **200**
22162217
| `»» icon` | string | false | | |
22172218
| `»» name` | string | false | | |
22182219
| `»» value` | string | false | | |
2220+
| `» required` | boolean | false | | |
22192221
| `» type` | string | false | | |
22202222
| `» validation_error` | string | false | | |
22212223
| `» validation_max` | integer | false | | |

provisioner/terraform/resources.go

+1
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ func ConvertState(modules []*tfjson.StateModule, rawGraph string) (*State, error
447447
Mutable: param.Mutable,
448448
DefaultValue: param.Default,
449449
Icon: param.Icon,
450+
Required: param.Default == "", // FIXME pull from terraform-provider-coder
450451
}
451452
if len(param.Validation) == 1 {
452453
protoParam.ValidationRegex = param.Validation[0].Regex

0 commit comments

Comments
 (0)