Error check stack delete

Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
aiordache 2020-10-01 10:31:37 +02:00
parent d3effd2ead
commit eadcb3be32
1 changed files with 3 additions and 2 deletions

View File

@ -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] + "..."