diff --git a/pkg/libstack/compose/composeplugin.go b/pkg/libstack/compose/composeplugin.go index 17126cc21..07fed9dbe 100644 --- a/pkg/libstack/compose/composeplugin.go +++ b/pkg/libstack/compose/composeplugin.go @@ -312,10 +312,6 @@ func createProject(ctx context.Context, configFilepaths []string, options libsta workingDir = filepath.Dir(configFilepaths[0]) } - if options.WorkingDir != "" { - workingDir = options.WorkingDir - } - if options.ProjectDir != "" { // When relative paths are used in the compose file, the project directory is used as the base path workingDir = options.ProjectDir diff --git a/pkg/libstack/compose/composeplugin_test.go b/pkg/libstack/compose/composeplugin_test.go index df71c5d36..a7121eadf 100644 --- a/pkg/libstack/compose/composeplugin_test.go +++ b/pkg/libstack/compose/composeplugin_test.go @@ -991,10 +991,12 @@ func Test_createProject(t *testing.T) { }, configFilepaths: []string{dir + "/docker-compose.yml"}, options: libstack.Options{ + // Note that this is the execution working directory not the compose project working directory + // and so it has no affect on the created projects working directory WorkingDir: "/something-totally-different", ProjectName: projectName, }, - expectedProject: expectedSimpleComposeProject("/something-totally-different", nil), + expectedProject: expectedSimpleComposeProject("", nil), }, { name: "Relative Working Directory", @@ -1003,10 +1005,12 @@ func Test_createProject(t *testing.T) { }, configFilepaths: []string{dir + "/docker-compose.yml"}, options: libstack.Options{ + // Note that this is the execution working directory not the compose project working directory + // and so it has no affect on the created projects working directory WorkingDir: "something-totally-different", ProjectName: projectName, }, - expectedProject: expectedSimpleComposeProject("something-totally-different", nil), + expectedProject: expectedSimpleComposeProject("", nil), }, { name: "Absolute Project Directory",