From 838937c90751615879a44059a6331ec85e4d8006 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 20 Aug 2020 15:18:03 +0200 Subject: [PATCH 1/2] workdir default value is defined by compose file Signed-off-by: Nicolas De Loof --- cli/cmd/compose/convert.go | 5 +++-- cli/cmd/compose/down.go | 2 +- cli/cmd/compose/logs.go | 2 +- cli/cmd/compose/ps.go | 2 +- cli/cmd/compose/up.go | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cli/cmd/compose/convert.go b/cli/cmd/compose/convert.go index 3eb798028..8c214912f 100644 --- a/cli/cmd/compose/convert.go +++ b/cli/cmd/compose/convert.go @@ -21,8 +21,9 @@ import ( "fmt" "github.com/compose-spec/compose-go/cli" - "github.com/docker/api/client" "github.com/spf13/cobra" + + "github.com/docker/api/client" ) func convertCommand() *cobra.Command { @@ -39,7 +40,7 @@ func convertCommand() *cobra.Command { }, } convertCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name") - convertCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir") + convertCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir") convertCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files") return convertCmd diff --git a/cli/cmd/compose/down.go b/cli/cmd/compose/down.go index a9bedddbf..200588419 100644 --- a/cli/cmd/compose/down.go +++ b/cli/cmd/compose/down.go @@ -35,7 +35,7 @@ func downCommand() *cobra.Command { }, } downCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name") - downCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir") + downCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir") downCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files") return downCmd diff --git a/cli/cmd/compose/logs.go b/cli/cmd/compose/logs.go index aa22e63d5..484e81e71 100644 --- a/cli/cmd/compose/logs.go +++ b/cli/cmd/compose/logs.go @@ -35,7 +35,7 @@ func logsCommand() *cobra.Command { }, } logsCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name") - logsCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir") + logsCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir") logsCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files") return logsCmd diff --git a/cli/cmd/compose/ps.go b/cli/cmd/compose/ps.go index 109e31908..ac17204e3 100644 --- a/cli/cmd/compose/ps.go +++ b/cli/cmd/compose/ps.go @@ -39,7 +39,7 @@ func psCommand() *cobra.Command { }, } psCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name") - psCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir") + psCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir") psCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files") return psCmd diff --git a/cli/cmd/compose/up.go b/cli/cmd/compose/up.go index 0cd28e9cf..0a8faf60c 100644 --- a/cli/cmd/compose/up.go +++ b/cli/cmd/compose/up.go @@ -35,7 +35,7 @@ func upCommand() *cobra.Command { }, } upCmd.Flags().StringVarP(&opts.Name, "project-name", "p", "", "Project name") - upCmd.Flags().StringVar(&opts.WorkingDir, "workdir", ".", "Work dir") + upCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir") upCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files") upCmd.Flags().StringArrayVarP(&opts.Environment, "environment", "e", []string{}, "Environment variables") upCmd.Flags().BoolP("detach", "d", true, " Detached mode: Run containers in the background") From e19a740102f5eb1ff45c299e2071fa3c133e9997 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Fri, 21 Aug 2020 09:57:01 +0200 Subject: [PATCH 2/2] Adapt aci compose test reflecting the change. Signed-off-by: Guillaume Tardif --- tests/aci-e2e/e2e-aci_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/aci-e2e/e2e-aci_test.go b/tests/aci-e2e/e2e-aci_test.go index 232c5a1f0..395063b9c 100644 --- a/tests/aci-e2e/e2e-aci_test.go +++ b/tests/aci-e2e/e2e-aci_test.go @@ -408,7 +408,7 @@ func TestCompose(t *testing.T) { const ( composeFile = "../composefiles/aci-demo/aci_demo_port.yaml" composeFileMultiplePorts = "../composefiles/aci-demo/aci_demo_multi_port.yaml" - composeProjectName = "acie2e" + composeProjectName = "acidemo" serverContainer = composeProjectName + "_web" wordsContainer = composeProjectName + "_words" )