From 99018ce462a2b306183e0077448a5548d38c1089 Mon Sep 17 00:00:00 2001 From: rangajal Date: Tue, 3 Nov 2020 07:35:28 +0000 Subject: [PATCH] namespace adaptation Change-Id: Id8441fa1a9984e73d8c3a9ab75713ee0ca493008 Signed-off-by: rangajal --- alarm/types.go | 9 ++++++--- build/run.sh | 7 ++++++- build/run_local.sh | 7 ++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/alarm/types.go b/alarm/types.go index 14a179c..3f55aed 100755 --- a/alarm/types.go +++ b/alarm/types.go @@ -23,6 +23,8 @@ package alarm import ( "sync" "unsafe" + "os" + "fmt" ) import "C" @@ -110,7 +112,8 @@ type AlarmDefinition struct { var RICAlarmDefinitions map[int]*AlarmDefinition var RICPerfAlarmObjects map[int]*Alarm -const ( - ALARM_MANAGER_HTTP_URL string = "http://service-ricplt-alarmmanager-http.ricplt:8080" - ALARM_MANAGER_RMR_URL string = "service-ricplt-alarmmanager-rmr.ricplt:4560" +var ( + namespace = os.Getenv("PLT_NAMESPACE") + ALARM_MANAGER_HTTP_URL string = fmt.Sprintf("http://service-%s-alarmmanager-http.%s:8080", namespace, namespace) + ALARM_MANAGER_RMR_URL string = fmt.Sprintf("service-%s-alarmmanager-rmr.%s:4560", namespace, namespace) ) diff --git a/build/run.sh b/build/run.sh index 9bf0178..d4dd036 100755 --- a/build/run.sh +++ b/build/run.sh @@ -23,7 +23,12 @@ # Date: 10 March 2020 # export RMR_SEED_RT=/cfg/uta_rtg.rt -export RMR_SRC_ID="service-ricplt-alarmmanager-rmr.ricplt" +namespace=$(env | grep PLT_NAMESPACE | grep -oe '[^=]*$') +if [ -z "$namespace" ] +then + namespace="ricplt" +fi +export RMR_SRC_ID="service-"$namespace"-alarmmanager-rmr."$namespace export DEF_FILE=./alarm-definition.json export PERF_DEF_FILE=./perf-alarm-definition.json export PERF_OBJ_FILE=./perf-alarm-object.json diff --git a/build/run_local.sh b/build/run_local.sh index 24fdd1a..55cc162 100755 --- a/build/run_local.sh +++ b/build/run_local.sh @@ -23,7 +23,12 @@ # Date: 10 March 2020 # export RMR_SEED_RT=$PWD/config/uta_rtg.rt -export RMR_SRC_ID="service-ricplt-alarmmanager-rmr.ricplt" +namespace=$(env | grep PLT_NAMESPACE | grep -oe '[^=]*$') +if [ -z "$namespace" ] +then + namespace="ricplt" +fi +export RMR_SRC_ID="service-"$namespace"-alarmmanager-rmr."$namespace export DEF_FILE=$PWD/definitions/alarm-definition.json export PERF_DEF_FILE=$PWD/testresources/perf-alarm-definition.json export PERF_OBJ_FILE=$PWD/testresources/perf-alarm-object.json -- 2.16.6