From 36130ae404e5fc465eb24654460793000f7d9a8f Mon Sep 17 00:00:00 2001 From: Nikita Podshivalov Date: Sat, 14 Aug 2021 12:33:17 +0300 Subject: [PATCH 1/3] fix destroy non-latest deployments in ECS --- builtin/aws/ecs/platform.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/aws/ecs/platform.go b/builtin/aws/ecs/platform.go index 9150ce64c32..befafac6a53 100644 --- a/builtin/aws/ecs/platform.go +++ b/builtin/aws/ecs/platform.go @@ -1340,7 +1340,7 @@ func destroyALB( if err != nil { return err } - } else if len(def) > 1 && def[0].ForwardConfig != nil { + } else if len(def[0].ForwardConfig.TargetGroups) > 1 && def[0].ForwardConfig != nil { // Multiple target groups means we can keep the listener var active bool From 5f3df584b29b3c56007391f5602c7a792b29ab28 Mon Sep 17 00:00:00 2001 From: Nikita Podshivalov <47272597+psihachina@users.noreply.github.com> Date: Wed, 18 Aug 2021 21:37:20 +0300 Subject: [PATCH 2/3] apply suggestions from code review Co-authored-by: Shirley Xiaolin Xu <34314221+xiaolin-ninja@users.noreply.github.com> --- builtin/aws/ecs/platform.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/aws/ecs/platform.go b/builtin/aws/ecs/platform.go index befafac6a53..823843ed493 100644 --- a/builtin/aws/ecs/platform.go +++ b/builtin/aws/ecs/platform.go @@ -1340,7 +1340,7 @@ func destroyALB( if err != nil { return err } - } else if len(def[0].ForwardConfig.TargetGroups) > 1 && def[0].ForwardConfig != nil { + } else if len(def) > 0 && def[0].ForwardConfig != nil && len(def[0].ForwardConfig.TargetGroups) > 1 { // Multiple target groups means we can keep the listener var active bool From cecbb6b03677644de94a6f6bba9bfd96ae1cf10b Mon Sep 17 00:00:00 2001 From: Nikita Podshivalov Date: Wed, 18 Aug 2021 21:41:25 +0300 Subject: [PATCH 3/3] add changelog --- .changelog/2054.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/2054.txt diff --git a/.changelog/2054.txt b/.changelog/2054.txt new file mode 100644 index 00000000000..607eb2755f1 --- /dev/null +++ b/.changelog/2054.txt @@ -0,0 +1,3 @@ +```release-note:bug +plugin/aws/ecs: fix destroy non-latest deployments in ECS +``` \ No newline at end of file