Use a goroutine when interacting with kube api

Signed-off-by: Charlie Getzen <charlie.getzen@procore.com>
pull/6571/head
Charlie Getzen 6 years ago
parent e247d30503
commit f7a05ba018

@ -273,8 +273,16 @@ func perform(infos ResourceList, fn func(*resource.Info) error) error {
return ErrNoObjectsVisited
}
errs := make(chan error)
for _, info := range infos {
if err := fn(info); err != nil {
go func(i *resource.Info) {
errs <- fn(i)
}(info)
}
for range infos {
err := <-errs
if err != nil {
return err
}
}

Loading…
Cancel
Save