You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ro...@apache.org on 2025/07/16 03:00:03 UTC
(apisix-ingress-controller) 01/01: fix: remove duplicate sync func
This is an automated email from the ASF dual-hosted git repository.
ronething pushed a commit to branch fix/remove_duplicate_func
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git
commit 14778a6e22d137480cd3ce7ecb8cc4f6e4f608a1
Author: ashing <ax...@gmail.com>
AuthorDate: Wed Jul 16 10:59:35 2025 +0800
fix: remove duplicate sync func
Signed-off-by: ashing <ax...@gmail.com>
---
internal/manager/run.go | 31 -------------------------------
1 file changed, 31 deletions(-)
diff --git a/internal/manager/run.go b/internal/manager/run.go
index 54ee31c8..b48746c1 100644
--- a/internal/manager/run.go
+++ b/internal/manager/run.go
@@ -21,7 +21,6 @@ import (
"context"
"crypto/tls"
"os"
- "time"
"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/runtime"
@@ -172,36 +171,6 @@ func Run(ctx context.Context, logger logr.Logger) error {
return err
}
- go func() {
- setupLog.Info("starting provider sync")
- initalSyncDelay := config.ControllerConfig.ProviderConfig.InitSyncDelay.Duration
- time.AfterFunc(initalSyncDelay, func() {
- setupLog.Info("trying to initialize provider")
- if err := provider.Sync(ctx); err != nil {
- setupLog.Error(err, "unable to sync resources to provider")
- return
- }
- })
-
- syncPeriod := config.ControllerConfig.ProviderConfig.SyncPeriod.Duration
- if syncPeriod < 1 {
- return
- }
- ticker := time.NewTicker(syncPeriod)
- defer ticker.Stop()
- for {
- select {
- case <-ticker.C:
- if err := provider.Sync(ctx); err != nil {
- setupLog.Error(err, "unable to sync resources to provider")
- return
- }
- case <-ctx.Done():
- return
- }
- }
- }()
-
setupLog.Info("check ReferenceGrants is enabled")
_, err = mgr.GetRESTMapper().KindsFor(schema.GroupVersionResource{
Group: v1beta1.GroupVersion.Group,