Browse code

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

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>

Arash Deshmeh authored on 2017/02/18 14:29:51
Showing 2 changed files
... ...
@@ -39,7 +39,7 @@ func interpolateSectionItem(
39 39
 		interpolatedValue, err := recursiveInterpolate(value, mapping)
40 40
 		if err != nil {
41 41
 			return nil, fmt.Errorf(
42
-				"Invalid interpolation format for %#v option in %s %#v: %#v",
42
+				"Invalid interpolation format for %#v option in %s %#v: %#v. You may need to escape any $ with another $.",
43 43
 				key, section, name, err.Template,
44 44
 			)
45 45
 		}
... ...
@@ -55,5 +55,5 @@ func TestInvalidInterpolation(t *testing.T) {
55 55
 		},
56 56
 	}
57 57
 	_, err := Interpolate(services, "service", defaultMapping)
58
-	assert.EqualError(t, err, `Invalid interpolation format for "image" option in service "servicea": "${"`)
58
+	assert.EqualError(t, err, `Invalid interpolation format for "image" option in service "servicea": "${". You may need to escape any $ with another $.`)
59 59
 }