From 81a352593ff4b75b97475ef11cbe8ab493797f57 Mon Sep 17 00:00:00 2001 From: nolouch Date: Wed, 10 Apr 2024 14:46:58 +0800 Subject: [PATCH] fix Signed-off-by: nolouch --- client/resource_group/controller/controller.go | 4 ++-- .../integrations/mcs/resourcemanager/resource_manager_test.go | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/resource_group/controller/controller.go b/client/resource_group/controller/controller.go index 8a2f53b91ddf..750a3c6e48f8 100755 --- a/client/resource_group/controller/controller.go +++ b/client/resource_group/controller/controller.go @@ -198,7 +198,7 @@ func loadServerConfig(ctx context.Context, provider ResourceGroupProvider) (*Con log.Warn("[resource group controller] server does not save config, load config failed") return DefaultConfig(), nil } - config := &Config{} + config := DefaultConfig() err = json.Unmarshal(kvs[0].GetValue(), config) if err != nil { return nil, err @@ -379,7 +379,7 @@ func (c *ResourceGroupsController) Start(ctx context.Context) { } for _, item := range resp { cfgRevision = item.Kv.ModRevision - config := &Config{} + config := DefaultConfig() if err := json.Unmarshal(item.Kv.Value, config); err != nil { continue } diff --git a/tests/integrations/mcs/resourcemanager/resource_manager_test.go b/tests/integrations/mcs/resourcemanager/resource_manager_test.go index 8686f5c5f120..f1ea8736fda2 100644 --- a/tests/integrations/mcs/resourcemanager/resource_manager_test.go +++ b/tests/integrations/mcs/resourcemanager/resource_manager_test.go @@ -1446,8 +1446,6 @@ func (suite *resourceManagerClientTestSuite) TestResourceGroupControllerConfigCh } expectRUCfg := controller.GenerateRUConfig(defaultCfg) expectRUCfg.DegradedModeWaitDuration = time.Second - expectRUCfg.WaitRetryInterval = 0 // server does not have it - expectRUCfg.WaitRetryTimes = 0 // server does not have it // initial config verification respString := sendRequest("GET", getAddr()+configURL, nil) expectStr, err := json.Marshal(expectCfg)