config: allow '/' in string args

This commit is contained in:
Mitchell Hashimoto 2014-08-21 11:33:52 -07:00
parent efaedbabb0
commit 4a3dff2441
3 changed files with 18 additions and 1 deletions

View File

@ -32,6 +32,7 @@ BUG FIXES:
* core: Variables are validated to not contain interpolations. [GH-180]
* core: Key files for provisioning can now contain `~` and will be expanded
to the user's home directory. [GH-179]
* core: The `file()` function can load files in sub-directories. [GH-213]
* providers/aws: Fix issues around failing to read EIPs. [GH-122]
* providers/aws: Autoscaling groups now register and export load
balancers. [GH-207]

View File

@ -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

View File

@ -87,6 +87,22 @@ func TestInterpolationWalker_detect(t *testing.T) {
},
},
},
{
Input: map[string]interface{}{
"foo": `${file("foo/bar.txt")}`,
},
Result: []Interpolation{
&FunctionInterpolation{
Func: nil,
Args: []Interpolation{
&LiteralInterpolation{
Literal: "foo/bar.txt",
},
},
},
},
},
}
for i, tc := range cases {