Parcourir la source

Error check stack delete

Signed-off-by: aiordache <[email protected]>
aiordache il y a 5 ans
Parent
commit
eadcb3be32
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      ecs/wait.go

+ 3 - 2
ecs/wait.go

@@ -112,10 +112,11 @@ func (b *ecsAPIService) WaitStackCompletion(ctx context.Context, name string, op
 			continue
 		}
 		if err := b.SDK.CheckStackState(ctx, name); err != nil {
+			if e := b.SDK.DeleteStack(ctx, name); e != nil {
+				return e
+			}
 			stackErr = err
-			b.SDK.DeleteStack(ctx, name)
 			operation = stackDelete
-
 			reason := err.Error()
 			if len(reason) > 30 {
 				reason = reason[:30] + "..."