From 85f0a7c22832202f6ae4adb196cca09c022bc29c Mon Sep 17 00:00:00 2001 From: defyrlt Date: Sat, 10 Apr 2021 01:29:57 +0300 Subject: [PATCH] Ignore previous CFM events on update to avoid false positive errors ECS `up` is pulling all events for CFM stack, which may be having some errors in the history. For example, if CFM stack update was ever cancelled, `up` will be exiting with code 1 on every run after that cancellation. Fixes #1112 Signed-off-by: defyrlt --- ecs/up.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ecs/up.go b/ecs/up.go index db1ce902f..d7d2a9b3a 100644 --- a/ecs/up.go +++ b/ecs/up.go @@ -93,6 +93,16 @@ func (b *ecsAPIService) Up(ctx context.Context, project *types.Project, options if err != nil { return err } + + var previousEvents []string + if update { + var err error + previousEvents, err = b.previousStackEvents(ctx, project.Name) + if err != nil { + return err + } + } + operation := stackCreate if update { operation = stackUpdate @@ -121,6 +131,6 @@ func (b *ecsAPIService) Up(ctx context.Context, project *types.Project, options b.Down(ctx, project.Name, compose.DownOptions{}) // nolint:errcheck }() - err = b.WaitStackCompletion(ctx, project.Name, operation) + err = b.WaitStackCompletion(ctx, project.Name, operation, previousEvents...) return err }