client-go: add retry logic for Watch and Stream

Kubernetes-commit: 607d3819498e64d969407c3d7cbbb8f53d98f0d4
This commit is contained in:
Abu Kashem
2021-05-18 15:15:28 -04:00
committed by Kubernetes Publisher
parent ccac415190
commit 55854fadb1
4 changed files with 651 additions and 248 deletions

View File

@@ -43,6 +43,10 @@ func (r IsRetryableErrorFunc) IsErrorRetryable(request *http.Request, err error)
return r(request, err)
}
var neverRetryError = IsRetryableErrorFunc(func(_ *http.Request, _ error) bool {
return false
})
// WithRetry allows the client to retry a request up to a certain number of times
// Note that WithRetry is not safe for concurrent use by multiple
// goroutines without additional locking or coordination.