X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fxapp%2Fsubscription.go;h=4ecc2624aec601eebd23c2d587a76c26be728c82;hb=refs%2Fchanges%2F19%2F5319%2F1;hp=27485dde76e1649b072439e2e8bb44fd08c3d3ca;hpb=47faec8c255f19f51e22c2fec203e6ed513c791f;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/xapp/subscription.go b/pkg/xapp/subscription.go index 27485dd..4ecc262 100755 --- a/pkg/xapp/subscription.go +++ b/pkg/xapp/subscription.go @@ -31,6 +31,7 @@ import ( "io/ioutil" "net" "net/http" + "os" "time" apiclient "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi" @@ -66,7 +67,11 @@ type Subscriber struct { func NewSubscriber(host string, timo int) *Subscriber { if host == "" { - host = "service-ricplt-submgr-http.ricplt:8088" + pltnamespace := os.Getenv("PLT_NAMESPACE") + if pltnamespace == "" { + pltnamespace = "ricplt" + } + host = fmt.Sprintf("service-%s-submgr-http.%s:8088", pltnamespace, pltnamespace) } if timo == 0 { @@ -165,7 +170,7 @@ func (r *Subscriber) Notify(resp *models.SubscriptionResponse, clientEndpoint st } ep, _, _ := net.SplitHostPort(clientEndpoint) - _, port, _ := net.SplitHostPort(viper.GetString("local.host")) + _, port, _ := net.SplitHostPort(fmt.Sprintf(":%d", GetPortData("http").Port)) clientUrl := fmt.Sprintf("http://%s:%s%s", ep, port, r.clientUrl) retries := viper.GetInt("subscription.retryCount")