Skip to content

Commit

Permalink
provider/aws: fix ECS service CheckDestroy in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phinze committed Dec 22, 2015
1 parent f473c2a commit 47f8b0c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin/providers/aws/resource_aws_ecs_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
Expand Down Expand Up @@ -210,6 +211,10 @@ func testAccCheckAWSEcsServiceDestroy(s *terraform.State) error {
Services: []*string{aws.String(rs.Primary.ID)},
})

if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "ClusterNotFoundException" {
continue
}

if err == nil {
if len(out.Services) > 0 {
return fmt.Errorf("ECS service still exists:\n%#v", out.Services)
Expand Down

0 comments on commit 47f8b0c

Please sign in to comment.