From da9d917a141a7885e2814faac3ecf733379a0a0f Mon Sep 17 00:00:00 2001 From: jay vyas Date: Wed, 23 Nov 2022 17:40:50 +0100 Subject: [PATCH] revert poller.go change, irrelevant --- tkg/clusterclient/poller.go | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/tkg/clusterclient/poller.go b/tkg/clusterclient/poller.go index 59b453348ff..7e7a4e2d0f9 100644 --- a/tkg/clusterclient/poller.go +++ b/tkg/clusterclient/poller.go @@ -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 }