From 673ea4d659ff8b326329f3bf822f186dcff6edbb Mon Sep 17 00:00:00 2001 From: shenyixiong Date: Sat, 17 Feb 2024 19:33:25 +0800 Subject: [PATCH] fix: ConfigStore duplicate lead to aeraki unable to get istiod connection status update Signed-off-by: shenyixiong --- internal/controller/istio/controller.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/controller/istio/controller.go b/internal/controller/istio/controller.go index 61c8f7b7..8725cc04 100644 --- a/internal/controller/istio/controller.go +++ b/internal/controller/istio/controller.go @@ -134,8 +134,14 @@ func (c *Controller) connectIstio() { time.Sleep(5 * time.Second) continue } - configController := memory.NewController(c.Store) - c.xdsMCP.Store = configController + + if c.configCache == nil { + controllerLog.Warn("configCache is nil") + c.xdsMCP.Store = memory.NewController(c.Store) + } else { + c.xdsMCP.Store = c.configCache + } + if err = c.xdsMCP.Run(); err != nil { controllerLog.Errorf("adsc: failed running %v", err) c.closeConnection()