From f2fced4876e09c75e4a7ff1e2bb8f32ca6b42075 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 19 Oct 2023 14:12:20 +0200 Subject: [PATCH] cli/compose/loader: remove platform-specific path handling Paths in the advanced / compose-file format are not converted to be platform-specific, so for these tests, it should not be needed to convert the paths to be Windows-paths. Signed-off-by: Sebastiaan van Stijn --- cli/compose/loader/full-struct_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/compose/loader/full-struct_test.go b/cli/compose/loader/full-struct_test.go index dca6f68d79..c195b65bfc 100644 --- a/cli/compose/loader/full-struct_test.go +++ b/cli/compose/loader/full-struct_test.go @@ -1,7 +1,6 @@ package loader import ( - "path/filepath" "time" "github.com/docker/cli/cli/compose/types" @@ -371,10 +370,10 @@ func services(workingDir, homeDir string) []types.ServiceConfig { {Target: "/var/lib/mysql", Type: "volume"}, {Source: "/opt/data", Target: "/var/lib/mysql", Type: "bind"}, {Source: workingDir, Target: "/code", Type: "bind"}, - {Source: filepath.Join(workingDir, "static"), Target: "/var/www/html", Type: "bind"}, + {Source: workingDir + "/static", Target: "/var/www/html", Type: "bind"}, {Source: homeDir + "/configs", Target: "/etc/configs/", Type: "bind", ReadOnly: true}, {Source: "datavolume", Target: "/var/lib/mysql", Type: "volume"}, - {Source: filepath.Join(workingDir, "opt"), Target: "/opt", Consistency: "cached", Type: "bind"}, + {Source: workingDir + "/opt", Target: "/opt", Consistency: "cached", Type: "bind"}, {Target: "/opt", Type: "tmpfs", Tmpfs: &types.ServiceVolumeTmpfs{ Size: int64(10000), }}, @@ -501,7 +500,7 @@ func volumes() map[string]types.VolumeConfig { func configs(workingDir string) map[string]types.ConfigObjConfig { return map[string]types.ConfigObjConfig{ "config1": { - File: filepath.Join(workingDir, "config_data"), + File: workingDir + "/config_data", Labels: map[string]string{ "foo": "bar", }, @@ -528,7 +527,7 @@ func configs(workingDir string) map[string]types.ConfigObjConfig { func secrets(workingDir string) map[string]types.SecretConfig { return map[string]types.SecretConfig{ "secret1": { - File: filepath.Join(workingDir, "secret_data"), + File: workingDir + "/secret_data", Labels: map[string]string{ "foo": "bar", },