mirror of
https://github.com/docker/compose.git
synced 2025-07-20 12:14:41 +02:00
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 <defyrlt@users.noreply.github.com>
This commit is contained in:
parent
80c82415d9
commit
85f0a7c228
12
ecs/up.go
12
ecs/up.go
@ -93,6 +93,16 @@ func (b *ecsAPIService) Up(ctx context.Context, project *types.Project, options
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var previousEvents []string
|
||||||
|
if update {
|
||||||
|
var err error
|
||||||
|
previousEvents, err = b.previousStackEvents(ctx, project.Name)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
operation := stackCreate
|
operation := stackCreate
|
||||||
if update {
|
if update {
|
||||||
operation = stackUpdate
|
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
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user