Only capture exit codes from `exit` events

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
Laura Brehm 2022-08-28 21:01:40 +02:00
parent 0d2beddf20
commit 8301dc8314
No known key found for this signature in database
GPG Key ID: 526E3FC49260D47A
1 changed files with 7 additions and 5 deletions

View File

@ -93,11 +93,13 @@ func (p *printer) Run(ctx context.Context, cascadeStop bool, exitCodeFrom string
return 0, err
}
}
if exitCodeFrom == "" {
exitCodeFrom = event.Service
}
if exitCodeFrom == event.Service {
exitCode = event.ExitCode
if event.Type == api.ContainerEventExit {
if exitCodeFrom == "" {
exitCodeFrom = event.Service
}
if exitCodeFrom == event.Service {
exitCode = event.ExitCode
}
}
}
if len(containers) == 0 {