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:
Nicolas De Loof 2020-04-28 10:37:35 +02:00
parent 541bda3af8
commit 30029fa701
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
3 changed files with 7 additions and 11 deletions

View File

@ -4,7 +4,6 @@ import (
"testing"
"github.com/docker/ecs-plugin/pkg/amazon/mock"
"github.com/docker/ecs-plugin/pkg/compose"
"github.com/golang/mock/gomock"
)
@ -21,9 +20,7 @@ func Test_down_dont_delete_cluster(t *testing.T) {
recorder := m.EXPECT()
recorder.DeleteStack("test_project").Return(nil).Times(1)
c.ComposeDown(&compose.Project{
Name: "test_project",
}, false)
c.ComposeDown("test_project", false)
}
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.DeleteCluster("test_cluster").Return(nil).Times(1)
c.ComposeDown(&compose.Project{
Name: "test_project",
}, true)
c.ComposeDown("test_project", true)
}

View File

@ -2,6 +2,7 @@ package amazon
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudformation"

View File

@ -8,14 +8,14 @@ import (
)
func Test_project_name(t *testing.T) {
p, err := projectFromOptions(&ProjectOptions{
p, err := ProjectFromOptions(&ProjectOptions{
name: "my_project",
ConfigPaths: []string{"testdata/simple/compose.yaml"},
})
assert.NilError(t, err)
assert.Equal(t, p.Name, "my_project")
p, err = projectFromOptions(&ProjectOptions{
p, err = ProjectFromOptions(&ProjectOptions{
name: "",
ConfigPaths: []string{"testdata/simple/compose.yaml"},
})
@ -23,7 +23,7 @@ func Test_project_name(t *testing.T) {
assert.Equal(t, p.Name, "simple")
os.Setenv("COMPOSE_PROJECT_NAME", "my_project_from_env")
p, err = projectFromOptions(&ProjectOptions{
p, err = ProjectFromOptions(&ProjectOptions{
name: "",
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) {
p, err := projectFromOptions(&ProjectOptions{
p, err := ProjectFromOptions(&ProjectOptions{
name: "my_project",
ConfigPaths: []string{
"testdata/simple/compose.yaml",