Skip to content

Commit

Permalink
fix data_source_code_variables
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber committed Aug 18, 2024
1 parent 6883560 commit ae4915d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion env0/data_source_code_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,20 @@ func dataSourceCodeVariablesRead(ctx context.Context, d *schema.ResourceData, me
return diag.Errorf("failed to extract variables from repository: %v", err)
}

if err := writeResourceDataSlice(variables, "variables", d); err != nil {
ivalues, err := writeResourceDataGetSliceValues(variables, "variables", d)
if err != nil {
return diag.Errorf("schema slice resource data serialization failed: %v", err)
}

for i, ivalue := range ivalues {
if variables[i].IsSensitive == nil || !*variables[i].IsSensitive {
ivariable := ivalue.(map[string]interface{})
ivariable["value"] = variables[i].Value
}
}

d.Set("variables", ivalues)

d.SetId(templateId)

return nil
Expand Down

0 comments on commit ae4915d

Please sign in to comment.