Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
revert poller.go change, irrelevant
Browse files Browse the repository at this point in the history
  • Loading branch information
jayunit100 committed Nov 23, 2022
1 parent 5097501 commit da9d917
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions tkg/clusterclient/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,31 +95,11 @@ func (p *pollerProxy) PollImmediateInfiniteWithGetter(interval time.Duration, ge
return true, nil
}

timeoutReached := false
ch := time.After(interval)
// dont return prematurely. workaround to the fact that
// apimachinery will prematurely return if any errors, but
// we want to be forgiving of race conditions for looking up the vsphere secrets, for example.
go func() {
<- ch
timeoutReached = true
}
for timeoutReached {
// note: APIMachinery will return immediately on failure, however, we don't want
// to always return immediately.
errPoll := p.PollImmediateInfinite(interval, pollerFunc)
if errPoll != nil {
// note: this function will return actual error which is thrown by getterFunc
// and will not return error of the PollImmediateInfinite call.
// note: caller shouldnt necessarily terminate on errors...
log.Info(errPoll.Error() + "underlying error:" + err.Error())
// not returning error yet...
} else {
log.V(6).Info("no errors, but not ready yet, retrying")
}


errPoll := p.PollImmediateInfinite(interval, pollerFunc)
if errPoll != nil {
// note: this function will return actual error which is thrown by getterFunc
// and will not return error of the PollImmediateInfinite call
return err
}

return nil
}

0 comments on commit da9d917

Please # to comment.