From ad4a2585ff0029be5ea987e1081e80f3c0e5d863 Mon Sep 17 00:00:00 2001 From: MUzairS15 Date: Tue, 23 Jan 2024 12:53:01 +0530 Subject: [PATCH] init config correctly Signed-off-by: MUzairS15 --- main.go | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/main.go b/main.go index c47b469b..07b22ff6 100644 --- a/main.go +++ b/main.go @@ -53,6 +53,19 @@ func main() { // no configs found from meshsync CRD log warning log.Warn(err) } + // Config init and seed + cfg, err := config.New(provider) + if err != nil { + log.Error(err) + os.Exit(1) + } + + config.Server["version"] = version + err = cfg.SetObject(config.ServerKey, config.Server) + if err != nil { + log.Error(err) + os.Exit(1) + } err = config.PatchCRVersion(&kubeClient.RestConfig) if err != nil { @@ -70,22 +83,8 @@ func main() { } } - // Config init and seed - cfg, err := config.New(provider) - if err != nil { - log.Error(err) - os.Exit(1) - } - cfg.SetKey(config.BrokerURL, os.Getenv("BROKER_URL")) - config.Server["version"] = version - err = cfg.SetObject(config.ServerKey, config.Server) - if err != nil { - log.Error(err) - os.Exit(1) - } - err = cfg.SetObject(config.ResourcesKey, config.Pipelines) if err != nil { log.Error(err)