mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
feat: use preview to compute workspace tags from terraform (#18720)
If using dynamic parameters, workspace tags are extracted using `coder/preview`.
This commit is contained in:
@ -25,6 +25,8 @@ type DynamicParameterTemplateParams struct {
|
||||
|
||||
// TemplateID is used to update an existing template instead of creating a new one.
|
||||
TemplateID uuid.UUID
|
||||
|
||||
Version func(request *codersdk.CreateTemplateVersionRequest)
|
||||
}
|
||||
|
||||
func DynamicParameterTemplate(t *testing.T, client *codersdk.Client, org uuid.UUID, args DynamicParameterTemplateParams) (codersdk.Template, codersdk.TemplateVersion) {
|
||||
@ -47,6 +49,9 @@ func DynamicParameterTemplate(t *testing.T, client *codersdk.Client, org uuid.UU
|
||||
if args.TemplateID != uuid.Nil {
|
||||
request.TemplateID = args.TemplateID
|
||||
}
|
||||
if args.Version != nil {
|
||||
args.Version(request)
|
||||
}
|
||||
})
|
||||
AwaitTemplateVersionJobCompleted(t, client, version.ID)
|
||||
|
||||
|
Reference in New Issue
Block a user