Skip to content

Commit

Permalink
Parameterise webui url (#207)
Browse files Browse the repository at this point in the history
Signed-off-by: gatici <gulsum.atici@canonical.com>
Co-authored-by: gab-arrobo <gabriel.arrobo@intel.com>
  • Loading branch information
gatici and gab-arrobo authored Mar 18, 2024
1 parent 94a5a89 commit 20010c0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions amfTest/amfcfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ configuration:
supportDnnList: # the DNN (Data Network Name) list supported by this AMF
- internet
nrfUri: http://127.0.0.10:8000 # a valid URI of NRF
webuiUri: webui:9876 # a valid URI of Webui
security: # NAS security parameters
integrityOrder: # the priority of integrity algorithms
- NIA2
Expand Down
1 change: 1 addition & 0 deletions factory/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type Configuration struct {
PlmnSupportList []PlmnSupportItem `yaml:"plmnSupportList,omitempty"`
SupportDnnList []string `yaml:"supportDnnList,omitempty"`
NrfUri string `yaml:"nrfUri,omitempty"`
WebuiUri string `yaml:"webuiUri"`
Security *Security `yaml:"security,omitempty"`
NetworkName NetworkName `yaml:"networkName,omitempty"`
T3502Value int `yaml:"t3502Value,omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ func InitConfigFactory(f string) error {
if yamlErr := yaml.Unmarshal(content, &AmfConfig); yamlErr != nil {
return yamlErr
}
if AmfConfig.Configuration.WebuiUri == "" {
AmfConfig.Configuration.WebuiUri = "webui:9876"
}
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (amf *AMF) Initialize(c *cli.Context) error {
factory.AmfConfig.Configuration.SupportTAIList = nil
factory.AmfConfig.Configuration.PlmnSupportList = nil
initLog.Infoln("Reading Amf related configuration from ROC")
client := gClient.ConnectToConfigServer("webui:9876")
client := gClient.ConnectToConfigServer(factory.AmfConfig.Configuration.WebuiUri)
configChannel := client.PublishOnConfigChange(true)
go amf.UpdateConfig(configChannel)
} else {
Expand Down

0 comments on commit 20010c0

Please sign in to comment.