mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #31147 from adshmh/30629-print-escaping-hint-on-invalid-interpolation-format
docker stack deploy interpolation format error due to not escaping $ now includes a hint
This commit is contained in:
commit
95b46ff68f
2 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ func interpolateSectionItem(
|
||||||
interpolatedValue, err := recursiveInterpolate(value, mapping)
|
interpolatedValue, err := recursiveInterpolate(value, mapping)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf(
|
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,
|
key, section, name, err.Template,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,5 +55,5 @@ func TestInvalidInterpolation(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err := Interpolate(services, "service", defaultMapping)
|
_, 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 $.`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue