|
|
@ -167,15 +167,6 @@ func parseHCL(dt []byte, fn string) (_ *Config, err error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
userFunctions, _, diags := userfunc.DecodeUserFunctions(file.Body, "function", func() *hcl.EvalContext {
|
|
|
|
|
|
|
|
return &hcl.EvalContext{
|
|
|
|
|
|
|
|
Functions: stdlibFunctions,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
|
|
|
return nil, diags
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var sc staticConfig
|
|
|
|
var sc staticConfig
|
|
|
|
|
|
|
|
|
|
|
|
// Decode only variable blocks without interpolation.
|
|
|
|
// Decode only variable blocks without interpolation.
|
|
|
@ -189,6 +180,16 @@ func parseHCL(dt []byte, fn string) (_ *Config, err error) {
|
|
|
|
variables[variable.Name] = cty.StringVal(variable.Default)
|
|
|
|
variables[variable.Name] = cty.StringVal(variable.Default)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userFunctions, _, diags := userfunc.DecodeUserFunctions(file.Body, "function", func() *hcl.EvalContext {
|
|
|
|
|
|
|
|
return &hcl.EvalContext{
|
|
|
|
|
|
|
|
Functions: stdlibFunctions,
|
|
|
|
|
|
|
|
Variables: variables,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
|
|
|
return nil, diags
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Override default with values from environment.
|
|
|
|
// Override default with values from environment.
|
|
|
|
for _, env := range os.Environ() {
|
|
|
|
for _, env := range os.Environ() {
|
|
|
|
parts := strings.SplitN(env, "=", 2)
|
|
|
|
parts := strings.SplitN(env, "=", 2)
|
|
|
|