Ignore errors when killing on second Ctrl-C

Signed-off-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
This commit is contained in:
Jaime Soriano Pastor 2024-04-12 16:54:01 +02:00 committed by Nicolas De loof
parent 5c1e5f3fc7
commit 5daed33c6a
1 changed files with 4 additions and 1 deletions

View File

@ -119,11 +119,14 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
gracefulTeardown()
} else {
eg.Go(func() error {
return s.Kill(context.Background(), project.Name, api.KillOptions{
// Intentionally ignore errors, for cases where some
// of the containers are already stopped.
s.kill(context.Background(), project.Name, api.KillOptions{
Services: options.Create.Services,
Project: project,
All: true,
})
return nil
})
return nil
}