docker compose interpolation format error now includes a hint on escaping $ characters.

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
This commit is contained in:
Arash Deshmeh 2017-02-18 00:29:51 -05:00
parent 3470c8d767
commit 6d2a7eebcb
2 changed files with 2 additions and 2 deletions

View file

@ -39,7 +39,7 @@ func interpolateSectionItem(
interpolatedValue, err := recursiveInterpolate(value, mapping)
if err != nil {
return nil, fmt.Errorf(
"Invalid interpolation format for %#v option in %s %#v: %#v",
"Invalid interpolation format for %#v option in %s %#v: %#v. You may need to escape any $ with another $.",
key, section, name, err.Template,
)
}

View file

@ -55,5 +55,5 @@ func TestInvalidInterpolation(t *testing.T) {
},
}
_, err := Interpolate(services, "service", defaultMapping)
assert.EqualError(t, err, `Invalid interpolation format for "image" option in service "servicea": "${"`)
assert.EqualError(t, err, `Invalid interpolation format for "image" option in service "servicea": "${". You may need to escape any $ with another $.`)
}