diff --git a/config/interpolate_walk.go b/config/interpolate_walk.go index 3e2d5db12..8e3831740 100644 --- a/config/interpolate_walk.go +++ b/config/interpolate_walk.go @@ -11,7 +11,7 @@ import ( // interpRegexp is a regexp that matches interpolations such as ${foo.bar} var interpRegexp *regexp.Regexp = regexp.MustCompile( - `(?i)(\$+)\{([\s*-.,\(\)a-z0-9_]+)\}`) + `(?i)(\$+)\{([\s*-.,\(\)a-z0-9_"]+)\}`) // interpolationWalker implements interfaces for the reflectwalk package // (github.com/mitchellh/reflectwalk) that can be used to automatically diff --git a/config/interpolate_walk_test.go b/config/interpolate_walk_test.go index e1ff006a3..ca733c709 100644 --- a/config/interpolate_walk_test.go +++ b/config/interpolate_walk_test.go @@ -71,6 +71,22 @@ func TestInterpolationWalker_detect(t *testing.T) { }, }, }, + + { + Input: map[string]interface{}{ + "foo": `${file("test.txt")}`, + }, + Result: []Interpolation{ + &FunctionInterpolation{ + Func: nil, + Args: []Interpolation{ + &LiteralInterpolation{ + Literal: "test.txt", + }, + }, + }, + }, + }, } for i, tc := range cases {