mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat: run a terraform plan before creating workspaces with the given template parameters (#1732)
This commit is contained in:
@ -13,11 +13,12 @@ import (
|
||||
|
||||
// ComputeScope targets identifiers to pull parameters from.
|
||||
type ComputeScope struct {
|
||||
TemplateImportJobID uuid.UUID
|
||||
OrganizationID uuid.UUID
|
||||
UserID uuid.UUID
|
||||
TemplateID uuid.NullUUID
|
||||
WorkspaceID uuid.NullUUID
|
||||
TemplateImportJobID uuid.UUID
|
||||
OrganizationID uuid.UUID
|
||||
UserID uuid.UUID
|
||||
TemplateID uuid.NullUUID
|
||||
WorkspaceID uuid.NullUUID
|
||||
AdditionalParameterValues []database.ParameterValue
|
||||
}
|
||||
|
||||
type ComputeOptions struct {
|
||||
@ -142,6 +143,14 @@ func Compute(ctx context.Context, db database.Store, scope ComputeScope, options
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, any additional parameter values declared in the input
|
||||
for _, v := range scope.AdditionalParameterValues {
|
||||
err = compute.injectSingle(v, false)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("inject single parameter value: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
values := make([]ComputedValue, 0, len(compute.computedParameterByName))
|
||||
for _, value := range compute.computedParameterByName {
|
||||
values = append(values, value)
|
||||
|
Reference in New Issue
Block a user