Add image pull concurrency limit.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-01-09 13:30:12 -08:00
parent 5abeeff84f
commit d7ed403072
10 changed files with 196 additions and 9 deletions

View File

@@ -178,3 +178,11 @@ func WithImageHandler(h images.Handler) RemoteOpt {
return nil
}
}
// WithMaxConcurrentDownloads sets max concurrent download limit.
func WithMaxConcurrentDownloads(max int) RemoteOpt {
return func(client *Client, c *RemoteContext) error {
c.MaxConcurrentDownloads = max
return nil
}
}