From ac354019f7b96010bf6ac9305b302bd7bc78adfd Mon Sep 17 00:00:00 2001 From: Roni Riska Date: Tue, 17 Sep 2019 12:56:52 +0300 Subject: [PATCH] Query Xapp config after subscription When the xapp notification subscription is done vesmgr makes a query of running xapps and recreates the vespa configuration and starts vespa. Vespa is not started before we have got the configuration from the xapp manager. Change-Id: I286fff7ed33e5704e6b9a18d1dd5358b6282bbdb Signed-off-by: Roni Riska --- cmd/vesmgr/vesmgr.go | 10 ++++++---- container-tag.yaml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/vesmgr/vesmgr.go b/cmd/vesmgr/vesmgr.go index 18ed793..0e27838 100755 --- a/cmd/vesmgr/vesmgr.go +++ b/cmd/vesmgr/vesmgr.go @@ -127,9 +127,6 @@ func vesmgrInit() { subscribeXAppNotifications(chXAppSubscriptions) - createConf([]byte{}) - startVesagent(chVesagent) - runVesmgr(chVesagent, chSupervision, chXAppNotifications, chXAppSubscriptions) } @@ -210,6 +207,7 @@ func runVesmgr(chVesagent chan error, chSupervision chan chan string, chXAppNoti logger.Info("vesmgr main loop ready") mystate := normalState var xappStatus []byte + var err error for { select { case supervision := <-chSupervision: @@ -225,7 +223,6 @@ func runVesmgr(chVesagent chan error, chSupervision chan chan string, chXAppNoti * the situation is fixed when the next * xapp notif comes */ - var err error xappStatus, err = queryConf() if err == nil { killVespa(vesagent.process) @@ -247,6 +244,11 @@ func runVesmgr(chVesagent chan error, chSupervision chan chan string, chXAppNoti logger.Error("Failed to make xApp subscriptions, vesmgr exiting: %s", isSubscribed.err) os.Exit(1) } + xappStatus, err = queryConf() + if err == nil { + createConf(xappStatus) + startVesagent(chVesagent) + } } } } diff --git a/container-tag.yaml b/container-tag.yaml index f5eba34..30299ec 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -1,4 +1,4 @@ # The Jenkins job uses this string for the tag in the image name # for example nexus3.o-ran-sc.org:10004/my-image-name:0.0.1 --- -tag: 0.0.2 +tag: 0.0.3 -- 2.16.6