1
0
mirror of https://github.com/moby/moby.git synced 2025-07-30 18:23:29 +03:00

Print which path failed when the mount source doesn't exist.

Changes Details:
--------------
Fixes: #36395

Refactoring the code to do the following:
1. Add the method `errBindSourceDoesNotExist` inside `validate.go` to be in-line with the rest of error message
2. Utilised the new method inside `linux_parser.go`, `windows_parser.go` and `validate_test.go`
3. Change the format from `bind mount source path: '%s' does not exist` to `bind mount source path does not exist: %s`
4. Reflected the format change into the 2 unit tests, namely: `volume_test.go` and `validate_test.go`
5. Reflected the format change into `docker_api_containers_test.go` integration test

Signed-off-by: Amr Gawish <amr.gawish@gmail.com>
This commit is contained in:
Amr Gawish
2018-02-26 02:10:46 +00:00
parent 6cb75dd5b6
commit df6af282b9
6 changed files with 11 additions and 9 deletions

View File

@ -1713,7 +1713,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsValidation(c *check.C) {
Type: "bind",
Source: notExistPath,
Target: destPath}}},
msg: "bind source path does not exist",
msg: "bind mount source path does not exist: " + notExistPath,
},
{
config: containertypes.Config{