Sfoglia il codice sorgente

Merge pull request #1522 from defyrlt/1112-ecs-exit-1-on-old-cfm-events

Ignore previous CFM events on update to avoid false positive errors
Nicolas De loof 4 anni fa
parent
commit
aaf662b7ed
1 ha cambiato i file con 11 aggiunte e 1 eliminazioni
  1. 11 1
      ecs/up.go

+ 11 - 1
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
 }