From 85b9098235099448faf355ad7f4c0cfb1d815ee7 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Mon, 13 Dec 2021 11:23:40 +0100 Subject: [PATCH] Revert "Pass compatibility flag to v2" --- redirect/convert.go | 4 ++-- redirect/convert_test.go | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/redirect/convert.go b/redirect/convert.go index f769dca..35beffb 100644 --- a/redirect/convert.go +++ b/redirect/convert.go @@ -24,8 +24,8 @@ var ( ) func Convert(args []string) []string { - var rootFlags []string - command := []string{"compose", "--compatibility"} + rootFlags := []string{} + command := []string{"compose"} l := len(args) for i := 0; i < l; i++ { arg := args[i] diff --git a/redirect/convert_test.go b/redirect/convert_test.go index b71b168..1db3fea 100644 --- a/redirect/convert_test.go +++ b/redirect/convert_test.go @@ -31,43 +31,44 @@ func Test_convert(t *testing.T) { { name: "compose only", args: []string{"up"}, - want: []string{"compose", "--compatibility", "up"}, + want: []string{"compose", "up"}, }, { name: "with context", args: []string{"--context", "foo", "-f", "compose.yaml", "up"}, - want: []string{"--context", "foo", "compose", "--compatibility", "-f", "compose.yaml", "up"}, + want: []string{"--context", "foo", "compose", "-f", "compose.yaml", "up"}, }, { name: "with host", args: []string{"--host", "tcp://1.2.3.4", "up"}, - want: []string{"--host", "tcp://1.2.3.4", "compose", "--compatibility", "up"}, + want: []string{"--host", "tcp://1.2.3.4", "compose", "up"}, }, { name: "compose --version", args: []string{"--version"}, - want: []string{"compose", "--compatibility", "version"}, + want: []string{"compose", "version"}, }, { name: "help", args: []string{"-h"}, - want: []string{"compose", "--compatibility", "--help"}, + want: []string{"compose", "--help"}, }, { name: "issues/1962", args: []string{"psql", "-h", "postgres"}, - want: []string{"compose", "--compatibility", "psql", "-h", "postgres"}, // -h should not be converted to --help + want: []string{"compose", "psql", "-h", "postgres"}, // -h should not be converted to --help }, { name: "issues/8648", args: []string{"exec", "mongo", "mongo", "--host", "mongo"}, - want: []string{"compose", "--compatibility", "exec", "mongo", "mongo", "--host", "mongo"}, // --host is passed to exec + want: []string{"compose", "exec", "mongo", "mongo", "--host", "mongo"}, // --host is passed to exec }, { name: "issues/12", args: []string{"--log-level", "INFO", "up"}, - want: []string{"--log-level", "INFO", "compose", "--compatibility", "up"}, + want: []string{"--log-level", "INFO", "compose", "up"}, }, + } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {