From 6d2a7eebcbdad0b7a44a27b4c65c9b3826b7e7f9 Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Sat, 18 Feb 2017 00:29:51 -0500 Subject: [PATCH] docker compose interpolation format error now includes a hint on escaping $ characters. Signed-off-by: Arash Deshmeh --- cli/compose/interpolation/interpolation.go | 2 +- cli/compose/interpolation/interpolation_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/compose/interpolation/interpolation.go b/cli/compose/interpolation/interpolation.go index 734f28ec9d..29c2e0e279 100644 --- a/cli/compose/interpolation/interpolation.go +++ b/cli/compose/interpolation/interpolation.go @@ -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, ) } diff --git a/cli/compose/interpolation/interpolation_test.go b/cli/compose/interpolation/interpolation_test.go index c3921701b3..1852b9eb44 100644 --- a/cli/compose/interpolation/interpolation_test.go +++ b/cli/compose/interpolation/interpolation_test.go @@ -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 $.`) }