Merge pull request #62 from thaJeztah/18.09_backport_tweak_error_message

[18.09] backport: tweak bind mount errors
This commit is contained in:
Andrew Hsu 2018-09-28 14:13:41 -07:00 committed by GitHub
commit e44436c31f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -1759,7 +1759,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsValidation(c *check.C) {
Target: destPath}}}, Target: destPath}}},
msg: "source path does not exist", msg: "source path does not exist",
// FIXME(vdemeester) fails into e2e, migrate to integration/container anyway // FIXME(vdemeester) fails into e2e, migrate to integration/container anyway
// msg: "bind mount source path does not exist: " + notExistPath, // msg: "source path does not exist: " + notExistPath,
}, },
{ {
config: containertypes.Config{ config: containertypes.Config{

View file

@ -120,7 +120,7 @@ func TestParseMountRaw(t *testing.T) {
`c:\:d:\:xyzzy`: "invalid volume specification: ", `c:\:d:\:xyzzy`: "invalid volume specification: ",
`c:`: "cannot be `c:`", `c:`: "cannot be `c:`",
`c:\`: "cannot be `c:`", `c:\`: "cannot be `c:`",
`c:\notexist:d:`: `bind mount source path does not exist: c:\notexist`, `c:\notexist:d:`: `source path does not exist: c:\notexist`,
`c:\windows\system32\ntdll.dll:d:`: `source path must be a directory`, `c:\windows\system32\ntdll.dll:d:`: `source path must be a directory`,
`name<:d:`: `invalid volume specification`, `name<:d:`: `invalid volume specification`,
`name>:d:`: `invalid volume specification`, `name>:d:`: `invalid volume specification`,
@ -189,7 +189,7 @@ func TestParseMountRaw(t *testing.T) {
`c:\:/foo:xyzzy`: "invalid volume specification: ", `c:\:/foo:xyzzy`: "invalid volume specification: ",
`/`: "destination can't be '/'", `/`: "destination can't be '/'",
`/..`: "destination can't be '/'", `/..`: "destination can't be '/'",
`c:\notexist:/foo`: `bind mount source path does not exist: c:\notexist`, `c:\notexist:/foo`: `source path does not exist: c:\notexist`,
`c:\windows\system32\ntdll.dll:/foo`: `source path must be a directory`, `c:\windows\system32\ntdll.dll:/foo`: `source path must be a directory`,
`name<:/foo`: `invalid volume specification`, `name<:/foo`: `invalid volume specification`,
`name>:/foo`: `invalid volume specification`, `name>:/foo`: `invalid volume specification`,

View file

@ -17,7 +17,7 @@ func (e *errMountConfig) Error() string {
} }
func errBindSourceDoesNotExist(path string) error { func errBindSourceDoesNotExist(path string) error {
return errors.Errorf("bind mount source path does not exist: %s", path) return errors.Errorf("bind source path does not exist: %s", path)
} }
func errExtraField(name string) error { func errExtraField(name string) error {