Merge "Revise Docker-based CI to build appmgr"
authorAbukar Mohamed <abukar.mohamed@nokia.com>
Fri, 19 Jul 2019 15:00:01 +0000 (15:00 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Fri, 19 Jul 2019 15:00:01 +0000 (15:00 +0000)
cmd/appmgr/subscriptions.go
cmd/appmgr/types.go
container-tag.yaml
helm_chart/appmgr/values.yaml

index 1db4c5a..40735a9 100755 (executable)
@@ -107,9 +107,13 @@ func (sd *SubscriptionDispatcher) notifyClients(xapps []Xapp, et EventType) {
 }
 
 func (sd *SubscriptionDispatcher) notify(xapps []Xapp, et EventType, s Subscription, seq int) error {
-       notif := []SubscriptionNotif{}
-       notif = append(notif, SubscriptionNotif{Id: s.req.Id, Version: seq, EventType: string(et), XappData: xapps})
+       xappData, err := json.Marshal(xapps)
+        if err != nil {
+                Logger.Info("json.Marshal failed: %v", err)
+                return err
+        }
 
+       notif := SubscriptionNotif{Id: s.req.Id, Version: seq, EventType: string(et), XApps: string(xappData)}
        jsonData, err := json.Marshal(notif)
        if err != nil {
                Logger.Info("json.Marshal failed: %v", err)
@@ -118,6 +122,7 @@ func (sd *SubscriptionDispatcher) notify(xapps []Xapp, et EventType, s Subscript
 
        // Execute the request with retry policy
        return sd.retry(s, func() error {
+               Logger.Info("Posting notification to targetUrl=%s: %v", s.req.TargetUrl, notif)
                resp, err := http.Post(s.req.TargetUrl, "application/json", bytes.NewBuffer(jsonData))
                if err != nil {
                        Logger.Info("Posting to subscription failed: %v", err)
index 685d118..34e3b74 100755 (executable)
@@ -123,7 +123,7 @@ type SubscriptionNotif struct {
        Id        string `json:"id"`
        Version   int    `json:"version"`
        EventType string `json:"eventType"`
-       XappData  []Xapp `json:"xapp"`
+       XApps     string `json:"xApps"`
 }
 
 type Subscription struct {
index 31d972c..82c5b6c 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:my-tag
 ---
-tag: '0.1.4'
+tag: '0.1.5'
index 268081b..a1c8bec 100755 (executable)
@@ -31,7 +31,7 @@ image:
 
   # xAppmanager Docker image name and tag
   name: appmgr
-  tag: 0.1.4
+  tag: 0.1.5
 
   #nameOverride: ""
   #fullnameOverride: ""