simplify hcl2 parsing helper

No need to pass in the entire eval context
This commit is contained in:
Michael Schurter
2019-02-02 12:19:16 -08:00
parent 3e52a6aacf
commit 1d17fbc681
4 changed files with 12 additions and 26 deletions

View File

@@ -11,7 +11,6 @@ import (
metrics "github.com/armon/go-metrics"
log "github.com/hashicorp/go-hclog"
multierror "github.com/hashicorp/go-multierror"
"github.com/hashicorp/hcl2/hcl"
"github.com/hashicorp/hcl2/hcldec"
"github.com/hashicorp/nomad/client/allocdir"
"github.com/hashicorp/nomad/client/allocrunner/interfaces"
@@ -620,12 +619,7 @@ func (tr *TaskRunner) runDriver() error {
tr.logger.Warn("some environment variables not available for rendering", "keys", strings.Join(keys, ", "))
}
evalCtx := &hcl.EvalContext{
Variables: vars,
Functions: hclutils.GetStdlibFuncs(),
}
val, diag := hclutils.ParseHclInterface(tr.task.Config, tr.taskSchema, evalCtx)
val, diag := hclutils.ParseHclInterface(tr.task.Config, tr.taskSchema, vars)
if diag.HasErrors() {
return multierror.Append(errors.New("failed to parse config"), diag.Errs()...)
}