From 20212829fbb9e5929c0f055ad7838512cf070e15 Mon Sep 17 00:00:00 2001 From: Gulsum Atici Date: Tue, 26 Mar 2024 08:03:16 +0300 Subject: [PATCH] chore: Parameterise webui URL (#70) * Parameterise webui URL Signed-off-by: gatici * Update config5g dependency --------- Signed-off-by: gatici Co-authored-by: Arrobo, Gabriel --- factory/config.example.yaml | 1 + factory/config.go | 1 + factory/factory.go | 5 ++++- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/factory/config.example.yaml b/factory/config.example.yaml index fcbead4..5d222e2 100644 --- a/factory/config.example.yaml +++ b/factory/config.example.yaml @@ -17,6 +17,7 @@ configuration: url: http://dummy authKeysDbName: authentication authUrl: http://dummy + webuiUri: webui:9876 plmnSupportList: - plmnId: mcc: "208" diff --git a/factory/config.go b/factory/config.go index 97513c6..d4ddc80 100644 --- a/factory/config.go +++ b/factory/config.go @@ -42,6 +42,7 @@ type Configuration struct { Sbi *Sbi `yaml:"sbi"` Mongodb *Mongodb `yaml:"mongodb"` NrfUri string `yaml:"nrfUri"` + WebuiUri string `yaml:"webuiUri"` PlmnSupportList []PlmnSupportItem `yaml:"plmnSupportList,omitempty"` } diff --git a/factory/factory.go b/factory/factory.go index ffa036f..322f174 100644 --- a/factory/factory.go +++ b/factory/factory.go @@ -57,10 +57,13 @@ func InitConfigFactory(f string) error { if UdrConfig.Configuration.Mongodb.AuthKeysDbName == "" { UdrConfig.Configuration.Mongodb.AuthKeysDbName = "authentication" } + if UdrConfig.Configuration.WebuiUri == "" { + UdrConfig.Configuration.WebuiUri = "webui:9876" + } roc := os.Getenv("MANAGED_BY_CONFIG_POD") if roc == "true" { initLog.Infoln("MANAGED_BY_CONFIG_POD is true") - commChannel := client.ConfigWatcher() + commChannel := client.ConfigWatcher(UdrConfig.Configuration.WebuiUri) ConfigUpdateDbTrigger = make(chan *UpdateDb, 10) go UdrConfig.updateConfig(commChannel, ConfigUpdateDbTrigger) } else { diff --git a/go.mod b/go.mod index 12c5d02..c6778f4 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gin-gonic/gin v1.9.1 github.com/google/uuid v1.6.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/omec-project/config5g v1.3.0 + github.com/omec-project/config5g v1.3.1 github.com/omec-project/http2_util v1.2.0 github.com/omec-project/logger_util v1.2.0 github.com/omec-project/openapi v1.2.0 diff --git a/go.sum b/go.sum index 2f00a57..586ab39 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,8 @@ github.com/montanaflynn/stats v0.6.6 h1:Duep6KMIDpY4Yo11iFsvyqJDyfzLF9+sndUKT+v6 github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= -github.com/omec-project/config5g v1.3.0 h1:e/oMZlQsef8bOpHT56uAMKIag3epCOW0jpmyadFC+30= -github.com/omec-project/config5g v1.3.0/go.mod h1:h6eaDdWEY7432L9rZAg1Za6HrvFvDWRNolAn5GK/5No= +github.com/omec-project/config5g v1.3.1 h1:hSvFHXh/J0mslsWR82PPnmpF0WzkmLa6AOdvEPve9e8= +github.com/omec-project/config5g v1.3.1/go.mod h1:lN/Jc2BZkE/smOGPCXxeo1dJ7s+s9Wgp34crNLH4YeE= github.com/omec-project/http2_util v1.2.0 h1:ggQ1GjY2x6VRpKuRhZj0t9dh6eISY6LRBv4rlMD++8s= github.com/omec-project/http2_util v1.2.0/go.mod h1:KLgvU3o7qmG/i5XO/qITscFql2tWCAmjE6glX+dxe7M= github.com/omec-project/logger_conf v1.1.1 h1:qo0cF5gnPfth8wy+I/QjiOx+F5jB6h4GLSOdyS+ted8=