From 06d3c21042eb2f4d8432e86f8857cac0babf43b0 Mon Sep 17 00:00:00 2001 From: gatici Date: Sun, 27 Oct 2024 14:05:40 +0300 Subject: [PATCH] move if clause to check MANAGED_BY_CONFIG_POD env value to service Signed-off-by: gatici --- factory/factory.go | 8 -------- service/init.go | 5 +++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/factory/factory.go b/factory/factory.go index 0e3b2a7..2678ea8 100644 --- a/factory/factory.go +++ b/factory/factory.go @@ -51,14 +51,6 @@ func InitConfigFactory(f string) error { if UdrConfig.Configuration.WebuiUri == "" { UdrConfig.Configuration.WebuiUri = "webui:9876" } - if os.Getenv("MANAGED_BY_CONFIG_POD") == "true" { - logger.InitLog.Infoln("MANAGED_BY_CONFIG_POD is true") - } else { - go func() { - logger.InitLog.Infoln("use helm chart config") - ConfigPodTrigger <- true - }() - } } return nil diff --git a/service/init.go b/service/init.go index 818a40f..b9f4600 100644 --- a/service/init.go +++ b/service/init.go @@ -92,6 +92,11 @@ func (udr *UDR) Initialize(c *cli.Context) error { if os.Getenv("MANAGED_BY_CONFIG_POD") == "true" { logger.InitLog.Infoln("MANAGED_BY_CONFIG_POD is true") go manageGrpcClient(factory.UdrConfig.Configuration.WebuiUri) + } else { + go func() { + logger.InitLog.Infoln("use helm chart config") + factory.ConfigPodTrigger <- true + }() } return nil