Skip to content

Commit

Permalink
Use EvaluateFile instead of deprecated EvaluateSnippet
Browse files Browse the repository at this point in the history
  • Loading branch information
alxrem committed Dec 23, 2020
1 parent 72000eb commit 023e3d8
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions jsonnet/data_source_jsonnet_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/hex"
"github.com/google/go-jsonnet"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"io/ioutil"
)

func dataSourceJsonnetFile() *schema.Resource {
Expand Down Expand Up @@ -72,12 +71,7 @@ func dataSourceJsonnetFileRead(d *schema.ResourceData, m interface{}) error {
vm.TLACode(name, value.(string))
}

snippet, err := ioutil.ReadFile(source)
if err != nil {
return err
}

output, err := vm.EvaluateSnippet(source, string(snippet))
output, err := vm.EvaluateFile(source)
if err != nil {
return err
}
Expand Down

0 comments on commit 023e3d8

Please sign in to comment.