Skip to content

feat: load variables from tfvars files #11549

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 19 commits into from
Jan 12, 2024
Prev Previous commit
Next Next commit
Fix nil assignment
  • Loading branch information
mtojek committed Jan 11, 2024
commit 667ffd626dcb18e61a6b3d65bdcc2b4e9e2ca4cc
4 changes: 2 additions & 2 deletions cli/templatevariables.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func parseVariableValuesFromHCL(content []byte) ([]codersdk.VariableValue, error
return nil, diags
}

var stringData map[string]string
stringData := map[string]string{}
for _, attribute := range attrs {
ctyValue, diags := attribute.Expr.Value(nil)
if diags.HasErrors() {
Expand Down Expand Up @@ -142,7 +142,7 @@ func parseVariableValuesFromJSON(content []byte) ([]codersdk.VariableValue, erro
return nil, err
}

stringData := make(map[string]string)
stringData := map[string]string{}
for key, value := range data {
switch value.(type) {
case string, int, bool:
Expand Down