mirror of https://github.com/k3s-io/k3s
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
commit
7e8de5422c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue