mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #54184 from MrHohn/fix-service-controller-retry
Automatic merge from submit-queue (batch tested with PRs 54107, 54184, 54377, 54094, 54111). 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>. Fix retry logic in service controller **What this PR does / why we need it**: Make service controller don't retry on doNotRetry service update failure. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #54183 **Special notes for your reviewer**: /assign @nicksardo @bowei **Release note**: ```release-note NONE ```
This commit is contained in:
commit
4ca155cbc1
@ -245,15 +245,17 @@ func (s *ServiceController) processServiceUpdate(cachedService *cachedService, s
|
|||||||
err, retry := s.createLoadBalancerIfNeeded(key, service)
|
err, retry := s.createLoadBalancerIfNeeded(key, service)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
message := "Error creating load balancer"
|
message := "Error creating load balancer"
|
||||||
|
var retryToReturn time.Duration
|
||||||
if retry {
|
if retry {
|
||||||
message += " (will retry): "
|
message += " (will retry): "
|
||||||
|
retryToReturn = cachedService.nextRetryDelay()
|
||||||
} else {
|
} else {
|
||||||
message += " (will not retry): "
|
message += " (will not retry): "
|
||||||
|
retryToReturn = doNotRetry
|
||||||
}
|
}
|
||||||
message += err.Error()
|
message += err.Error()
|
||||||
s.eventRecorder.Event(service, v1.EventTypeWarning, "CreatingLoadBalancerFailed", message)
|
s.eventRecorder.Event(service, v1.EventTypeWarning, "CreatingLoadBalancerFailed", message)
|
||||||
|
return err, retryToReturn
|
||||||
return err, cachedService.nextRetryDelay()
|
|
||||||
}
|
}
|
||||||
// Always update the cache upon success.
|
// Always update the cache upon success.
|
||||||
// NOTE: Since we update the cached service if and only if we successfully
|
// NOTE: Since we update the cached service if and only if we successfully
|
||||||
|
Loading…
Reference in New Issue
Block a user