mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
ComposeDown only require stack name
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com> g Sur la branche api Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
541bda3af8
commit
30029fa701
@ -4,7 +4,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/ecs-plugin/pkg/amazon/mock"
|
"github.com/docker/ecs-plugin/pkg/amazon/mock"
|
||||||
"github.com/docker/ecs-plugin/pkg/compose"
|
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -21,9 +20,7 @@ func Test_down_dont_delete_cluster(t *testing.T) {
|
|||||||
recorder := m.EXPECT()
|
recorder := m.EXPECT()
|
||||||
recorder.DeleteStack("test_project").Return(nil).Times(1)
|
recorder.DeleteStack("test_project").Return(nil).Times(1)
|
||||||
|
|
||||||
c.ComposeDown(&compose.Project{
|
c.ComposeDown("test_project", false)
|
||||||
Name: "test_project",
|
|
||||||
}, false)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_down_delete_cluster(t *testing.T) {
|
func Test_down_delete_cluster(t *testing.T) {
|
||||||
@ -40,7 +37,5 @@ func Test_down_delete_cluster(t *testing.T) {
|
|||||||
recorder.DeleteStack("test_project").Return(nil).Times(1)
|
recorder.DeleteStack("test_project").Return(nil).Times(1)
|
||||||
recorder.DeleteCluster("test_cluster").Return(nil).Times(1)
|
recorder.DeleteCluster("test_cluster").Return(nil).Times(1)
|
||||||
|
|
||||||
c.ComposeDown(&compose.Project{
|
c.ComposeDown("test_project", true)
|
||||||
Name: "test_project",
|
|
||||||
}, true)
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package amazon
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
"github.com/aws/aws-sdk-go/service/cloudformation"
|
"github.com/aws/aws-sdk-go/service/cloudformation"
|
||||||
|
@ -8,14 +8,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Test_project_name(t *testing.T) {
|
func Test_project_name(t *testing.T) {
|
||||||
p, err := projectFromOptions(&ProjectOptions{
|
p, err := ProjectFromOptions(&ProjectOptions{
|
||||||
name: "my_project",
|
name: "my_project",
|
||||||
ConfigPaths: []string{"testdata/simple/compose.yaml"},
|
ConfigPaths: []string{"testdata/simple/compose.yaml"},
|
||||||
})
|
})
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Equal(t, p.Name, "my_project")
|
assert.Equal(t, p.Name, "my_project")
|
||||||
|
|
||||||
p, err = projectFromOptions(&ProjectOptions{
|
p, err = ProjectFromOptions(&ProjectOptions{
|
||||||
name: "",
|
name: "",
|
||||||
ConfigPaths: []string{"testdata/simple/compose.yaml"},
|
ConfigPaths: []string{"testdata/simple/compose.yaml"},
|
||||||
})
|
})
|
||||||
@ -23,7 +23,7 @@ func Test_project_name(t *testing.T) {
|
|||||||
assert.Equal(t, p.Name, "simple")
|
assert.Equal(t, p.Name, "simple")
|
||||||
|
|
||||||
os.Setenv("COMPOSE_PROJECT_NAME", "my_project_from_env")
|
os.Setenv("COMPOSE_PROJECT_NAME", "my_project_from_env")
|
||||||
p, err = projectFromOptions(&ProjectOptions{
|
p, err = ProjectFromOptions(&ProjectOptions{
|
||||||
name: "",
|
name: "",
|
||||||
ConfigPaths: []string{"testdata/simple/compose.yaml"},
|
ConfigPaths: []string{"testdata/simple/compose.yaml"},
|
||||||
})
|
})
|
||||||
@ -32,7 +32,7 @@ func Test_project_name(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_project_from_set_of_files(t *testing.T) {
|
func Test_project_from_set_of_files(t *testing.T) {
|
||||||
p, err := projectFromOptions(&ProjectOptions{
|
p, err := ProjectFromOptions(&ProjectOptions{
|
||||||
name: "my_project",
|
name: "my_project",
|
||||||
ConfigPaths: []string{
|
ConfigPaths: []string{
|
||||||
"testdata/simple/compose.yaml",
|
"testdata/simple/compose.yaml",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user