package backend

import (
	"context"

	"github.com/docker/ecs-plugin/pkg/amazon/types"
	"github.com/docker/ecs-plugin/pkg/compose"
)

func (b *Backend) Down(ctx context.Context, options compose.ProjectOptions) error {
	project, err := compose.ProjectFromOptions(&options)
	if err != nil {
		return err
	}

	err = b.api.DeleteStack(ctx, project.Name)
	if err != nil {
		return err
	}

	err = b.WaitStackCompletion(ctx, project.Name, types.StackDelete)
	if err != nil {
		return err
	}
	return nil
}

package backend

import (
	"context"

	"github.com/docker/ecs-plugin/pkg/amazon/types"
	"github.com/docker/ecs-plugin/pkg/compose"
)

func (b *Backend) Down(ctx context.Context, options compose.ProjectOptions) error {
	name := options.Name
	if name == "" {
		project, err := compose.ProjectFromOptions(&options)
		if err != nil {
			return err
		}
		name = project.Name
	}

	err := b.api.DeleteStack(ctx, name)
	if err != nil {
		return err
	}

	err = b.WaitStackCompletion(ctx, name, types.StackDelete)
	if err != nil {
		return err
	}
	return nil
}

Fix broken build on master
Fix broken build on master

Signed-off-by: Nicolas De Loof <27d8e526c390473e9c51da80626c6b0539b42f4f@gmail.com>
