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>
This commit is contained in:
Sebastiaan van Stijn 2023-10-19 14:12:20 +02:00
parent 74990623e5
commit f2fced4876
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 4 additions and 5 deletions

View File

@ -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",
},