Query Xapp config after subscription 63/963/3
authorRoni Riska <roni.riska@nokia.com>
Tue, 17 Sep 2019 09:56:52 +0000 (12:56 +0300)
committerRoni Riska <roni.riska@nokia.com>
Thu, 19 Sep 2019 09:45:29 +0000 (12:45 +0300)
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 <roni.riska@nokia.com>
cmd/vesmgr/vesmgr.go
container-tag.yaml

index 18ed793..0e27838 100755 (executable)
@@ -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)
+                       }
                }
        }
 }
index f5eba34..30299ec 100644 (file)
@@ -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