mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-06 19:49:08 +00:00
Merge pull request #112476 from enj/enj/i/list_pager_flake
Check for context cancellation on each buffered chunk Kubernetes-commit: be506dc46e4ba13c701bd8f228a4d1d1581873be
This commit is contained in:
commit
ece64627e4
@ -203,6 +203,11 @@ func (p *ListPager) eachListChunkBuffered(ctx context.Context, options metav1.Li
|
||||
}()
|
||||
|
||||
for o := range chunkC {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
default:
|
||||
}
|
||||
err := fn(o)
|
||||
if err != nil {
|
||||
return err // any fn error should be returned immediately
|
||||
|
Loading…
Reference in New Issue
Block a user