Update ncm code for upstream changes 00/107000/2
authorRajamohan Raj <rajamohan.raj@intel.com>
Fri, 1 May 2020 22:45:00 +0000 (22:45 +0000)
committerRajamohan Raj <rajamohan.raj@intel.com>
Fri, 1 May 2020 22:58:54 +0000 (22:58 +0000)
The signature of two functions of upstream code
in orchestration is to be changed.
The new function signature for changes in appcontext.go:

AddResource(handle interface{}, resname string, value []byte)
UpdateResourceValue(handle interface{}, value []byte)
The above code shall be pushed in the next patch for
orchestration

Issue-ID: MULTICLOUD-1064
Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com>
Change-Id: I58db28e2e0ea27fba9b88839156a43517cdad1c9

src/ncm/pkg/module/cluster.go
src/ncm/pkg/module/netcontrolintent.go

index 2397a09..e0464c9 100644 (file)
@@ -512,7 +512,7 @@ func (v *ClusterClient) ApplyNetworkIntents(provider, name string) error {
 
        // add the resources to the app context
        for _, resource := range resources {
-               _, err = context.AddResource(clusterhandle, resource.name, resource.value)
+               _, err = context.AddResource(clusterhandle, resource.name, []byte(resource.value))
                if err != nil {
                        cleanuperr := context.DeleteCompositeApp()
                        if cleanuperr != nil {
index c005a93..da8f9a8 100644 (file)
@@ -281,7 +281,7 @@ func (v *NetControlIntentClient) ApplyNetControlIntent(name, project, compositea
                        }
 
                        // Update resource in AppContext
-                       err = context.UpdateResourceValue(rh, string(y))
+                       err = context.UpdateResourceValue(rh, y)
                        if err != nil {
                                log.Error("Network updating app context resource handle", log.Fields{
                                        "error":           err,