Merge pull request #56394 from porridge/fetch-token-retry-longer

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Try longer to fetch initial token.

**What this PR does / why we need it**:
Step towards fixing #56293

**Special notes for your reviewer**:
/kind bug
/priority critial-urgent
@kubernetes/sig-scalability-bugs
/cc @shyamjvs please add to v1.9

**Release note**:
```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2018-02-15 08:31:03 -08:00 committed by GitHub
commit 7e8de5422c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -843,7 +843,13 @@ func newOauthClient(tokenSource oauth2.TokenSource) (*http.Client, error) {
glog.Infof("Using existing Token Source %#v", tokenSource)
}
if err := wait.PollImmediate(5*time.Second, 30*time.Second, func() (bool, error) {
backoff := wait.Backoff{
// These values will add up to about a minute. See #56293 for background.
Duration: time.Second,
Factor: 1.4,
Steps: 10,
}
if err := wait.ExponentialBackoff(backoff, func() (bool, error) {
if _, err := tokenSource.Token(); err != nil {
glog.Errorf("error fetching initial token: %v", err)
return false, nil