Skip to content

Commit f2fced4

Browse files
committed
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 <github@gone.nl>
1 parent 7499062 commit f2fced4

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

cli/compose/loader/full-struct_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package loader
22

33
import (
4-
"path/filepath"
54
"time"
65

76
"github.com/docker/cli/cli/compose/types"
@@ -371,10 +370,10 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
371370
{Target: "/var/lib/mysql", Type: "volume"},
372371
{Source: "/opt/data", Target: "/var/lib/mysql", Type: "bind"},
373372
{Source: workingDir, Target: "/code", Type: "bind"},
374-
{Source: filepath.Join(workingDir, "static"), Target: "/var/www/html", Type: "bind"},
373+
{Source: workingDir + "/static", Target: "/var/www/html", Type: "bind"},
375374
{Source: homeDir + "/configs", Target: "/etc/configs/", Type: "bind", ReadOnly: true},
376375
{Source: "datavolume", Target: "/var/lib/mysql", Type: "volume"},
377-
{Source: filepath.Join(workingDir, "opt"), Target: "/opt", Consistency: "cached", Type: "bind"},
376+
{Source: workingDir + "/opt", Target: "/opt", Consistency: "cached", Type: "bind"},
378377
{Target: "/opt", Type: "tmpfs", Tmpfs: &types.ServiceVolumeTmpfs{
379378
Size: int64(10000),
380379
}},
@@ -501,7 +500,7 @@ func volumes() map[string]types.VolumeConfig {
501500
func configs(workingDir string) map[string]types.ConfigObjConfig {
502501
return map[string]types.ConfigObjConfig{
503502
"config1": {
504-
File: filepath.Join(workingDir, "config_data"),
503+
File: workingDir + "/config_data",
505504
Labels: map[string]string{
506505
"foo": "bar",
507506
},
@@ -528,7 +527,7 @@ func configs(workingDir string) map[string]types.ConfigObjConfig {
528527
func secrets(workingDir string) map[string]types.SecretConfig {
529528
return map[string]types.SecretConfig{
530529
"secret1": {
531-
File: filepath.Join(workingDir, "secret_data"),
530+
File: workingDir + "/secret_data",
532531
Labels: map[string]string{
533532
"foo": "bar",
534533
},

0 commit comments

Comments
 (0)