diff --git a/CHANGELOG.md b/CHANGELOG.md index d7800ac8d9..733d92c267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ # Table of Contents +- [1.8.3](#182) - [1.8.2](#182) - [1.8.1](#181) - [1.8.0](#180) @@ -41,6 +42,18 @@ - [0.2.0](#020) - [0.1.0](#010) +# 1.8.3 + +## What's New + +- fix: candidate controllers missing Forget call in workqueue @Revolyssup (#2308) + +## 👨🏽‍💻 Contributors + +Thank you to our contributors for making this release possible: +@Revolyssup + + # 1.8.2 ## What's New diff --git a/pkg/providers/apisix/apisix_global_rule.go b/pkg/providers/apisix/apisix_global_rule.go index 69b3d11fdd..4948543d4f 100644 --- a/pkg/providers/apisix/apisix_global_rule.go +++ b/pkg/providers/apisix/apisix_global_rule.go @@ -179,6 +179,13 @@ func (c *apisixGlobalRuleController) sync(ctx context.Context, ev *types.Event) } func (c *apisixGlobalRuleController) handleSyncErr(obj interface{}, errOrigin error) { + if errOrigin == nil { + c.MetricsCollector.IncrSyncOperation("GlobalRule", "success") + c.workqueue.Forget(obj) + } else { + c.workqueue.AddRateLimited(obj) + c.MetricsCollector.IncrSyncOperation("GlobalRule", "failure") + } ev := obj.(*types.Event) event := ev.Object.(kube.ApisixGlobalRuleEvent) if k8serrors.IsNotFound(errOrigin) && ev.Type != types.EventDelete { @@ -219,8 +226,6 @@ func (c *apisixGlobalRuleController) handleSyncErr(obj interface{}, errOrigin er ) } } - c.workqueue.Forget(obj) - c.MetricsCollector.IncrSyncOperation("GlobalRule", "success") return } log.Warnw("sync ApisixGlobalRule failed, will retry", @@ -241,8 +246,6 @@ func (c *apisixGlobalRuleController) handleSyncErr(obj interface{}, errOrigin er ) } } - c.workqueue.AddRateLimited(obj) - c.MetricsCollector.IncrSyncOperation("GlobalRule", "failure") } func (c *apisixGlobalRuleController) onAdd(obj interface{}) {