Split runc shim into plugin components

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2021-09-16 17:56:14 -07:00
parent 6eea8f3f62
commit 6835a94707
4 changed files with 346 additions and 252 deletions

View File

@@ -75,7 +75,8 @@ func (s *shutdownService) Shutdown() {
ctx, cancel := context.WithTimeout(context.Background(), s.timeout)
defer cancel()
grp, ctx := errgroup.WithContext(ctx)
for _, fn := range callbacks {
for i := range callbacks {
fn := callbacks[i]
grp.Go(func() error { return fn(ctx) })
}
err := grp.Wait()