浏览代码

DescribeStacks fail with error if stack does not exists

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 5 年之前
父节点
当前提交
48096eeed8
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      ecs/pkg/amazon/up.go

+ 3 - 5
ecs/pkg/amazon/up.go

@@ -10,13 +10,11 @@ import (
 )
 )
 
 
 func (c *client) ComposeUp(project *compose.Project, loadBalancerArn *string) error {
 func (c *client) ComposeUp(project *compose.Project, loadBalancerArn *string) error {
-	stacks, err := c.CF.DescribeStacks(&cloudformation.DescribeStacksInput{
+	_, err := c.CF.DescribeStacks(&cloudformation.DescribeStacksInput{
 		StackName: aws.String(project.Name),
 		StackName: aws.String(project.Name),
 	})
 	})
-	if err != nil {
-		return err
-	}
-	if len(stacks.Stacks) > 0 {
+	if err == nil {
+		// FIXME no ErrNotFound err type here
 		return fmt.Errorf("we do not (yet) support updating an existing CloudFormation stack")
 		return fmt.Errorf("we do not (yet) support updating an existing CloudFormation stack")
 	}
 	}