Remove orchestrator dependency from ncm 18/106218/1
authorRajamohan Raj <rajamohan.raj@intel.com>
Fri, 17 Apr 2020 20:51:36 +0000 (20:51 +0000)
committerRajamohan Raj <rajamohan.raj@intel.com>
Fri, 17 Apr 2020 20:51:36 +0000 (20:51 +0000)
NCM shall be like a library which orchestrator shall
call as and when required. NCM will assume that whenever
orchestrator calls it all the validation of orchestrator components
is done, so NCM shall not validate orchestrator components.
Otherwise, if NCM calls the orchestration, this will result
in cyclic import issue.

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

src/ncm/pkg/module/netcontrolintent.go

index e94dd9d..5ef9dff 100644 (file)
@@ -18,7 +18,7 @@ package module
 
 import (
        "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/db"
-       orchestrator "github.com/onap/multicloud-k8s/src/orchestrator/pkg/module"
+
 
        pkgerrors "github.com/pkg/errors"
 )
@@ -72,14 +72,8 @@ func (v *NetControlIntentClient) CreateNetControlIntent(nci NetControlIntent, pr
                CompositeAppVersion: compositeappversion,
        }
 
-       //Check if composite app/version exists
-       _, err := orchestrator.NewCompositeAppClient().GetCompositeApp(compositeapp, compositeappversion, project)
-       if err != nil {
-               return NetControlIntent{}, pkgerrors.New("Unable to find the composite app/version")
-       }
-
        //Check if this NetControlIntent already exists
-       _, err = v.GetNetControlIntent(nci.Metadata.Name, project, compositeapp, compositeappversion)
+       _, err := v.GetNetControlIntent(nci.Metadata.Name, project, compositeapp, compositeappversion)
        if err == nil && !exists {
                return NetControlIntent{}, pkgerrors.New("NetControlIntent already exists")
        }