Try longer to fetch initial token.

This commit is contained in:
Marcin Owsiany 2017-11-27 08:41:26 +01:00
parent 9f80ae7410
commit 3a5d48700c

View File

@ -827,7 +827,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