DockerCLI/cli/compose/loader
Sebastiaan van Stijn d6dd08d568
Detect Windows absolute paths on non-Windows CLI
When deploying a stack using a relative path as bind-mount
source in the compose file, the CLI converts the relative
path to an absolute path, relative to the location of the
docker-compose file.

This causes a problem when deploying a stack that uses
an absolute Windows path, because a non-Windows client will
fail to detect that the path (e.g. `C:\somedir`) is an absolute
path (and not a relative directory named `C:\`).

The existing code did already take Windows clients deploying
a Linux stack into account (by checking if the path had a leading
slash). This patch adds the reverse, and adds detection for Windows
absolute paths on non-Windows clients.

The code used to detect Windows absolute paths is copied from the
Golang filepath package;
1d0e94b1e1/src/path/filepath/path_windows.go (L12-L65)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-10 21:25:03 +02:00
..
example1.env Import docker/docker/cli 2017-04-17 17:40:59 -04:00
example2.env Import docker/docker/cli 2017-04-17 17:40:59 -04:00
full-example.yml Add systctl support for services 2019-03-19 13:33:32 +01:00
full-struct_test.go Add systctl support for services 2019-03-19 13:33:32 +01:00
interpolate.go Rollback config type interpolation on fields "parallelism" and "max_failure_ratio" were missing, as it uses the same type as update_config. 2019-07-03 17:23:33 +02:00
loader.go Detect Windows absolute paths on non-Windows CLI 2019-07-10 21:25:03 +02:00
loader_test.go Detect Windows absolute paths on non-Windows CLI 2019-07-10 21:25:03 +02:00
merge.go Fix error with merge composefile with networks… 2018-04-05 10:37:35 +02:00
merge_test.go Update tests to use gotest.tools 👼 2018-06-08 18:24:26 +02:00
types_test.go Allow marshalling of Compose config to JSON 2018-09-10 11:16:05 -07:00
volume.go Support parsing of named pipes for compose volumes. 2017-09-26 11:24:23 -04:00
volume_test.go Update tests to use gotest.tools 👼 2018-06-08 18:24:26 +02:00
windows_path.go Detect Windows absolute paths on non-Windows CLI 2019-07-10 21:25:03 +02:00
windows_path_test.go Detect Windows absolute paths on non-Windows CLI 2019-07-10 21:25:03 +02:00