diff --git a/helper/config/decode.go b/helper/config/decode.go index 177f8f930..620198e35 100644 --- a/helper/config/decode.go +++ b/helper/config/decode.go @@ -42,6 +42,8 @@ func Decode(target interface{}, config *DecodeOpts, raws ...interface{}) error { if config.InterpolateContext == nil { config.InterpolateContext = ctx } else { + config.InterpolateContext.BuildName = ctx.BuildName + config.InterpolateContext.BuildType = ctx.BuildType config.InterpolateContext.TemplatePath = ctx.TemplatePath config.InterpolateContext.UserVariables = ctx.UserVariables } diff --git a/template/interpolate/funcs.go b/template/interpolate/funcs.go index e5d01b455..75e1344ed 100644 --- a/template/interpolate/funcs.go +++ b/template/interpolate/funcs.go @@ -71,7 +71,7 @@ func funcGenBuildName(ctx *Context) interface{} { func funcGenBuildType(ctx *Context) interface{} { return func() (string, error) { if ctx == nil || ctx.BuildType == "" { - return "", errors.New("build_name not available") + return "", errors.New("build_type not available") } return ctx.BuildType, nil