From 1c3a22e3de0dd24b4161ae8b34794627620a208b Mon Sep 17 00:00:00 2001 From: Rajamohan Raj Date: Fri, 17 Apr 2020 20:51:36 +0000 Subject: Remove orchestrator dependency from ncm 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 Change-Id: Ie352c730ffd39863d6de23d6a9a9a934f460392b --- src/ncm/pkg/module/netcontrolintent.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ncm/pkg/module/netcontrolintent.go b/src/ncm/pkg/module/netcontrolintent.go index e94dd9db..5ef9dffe 100644 --- a/src/ncm/pkg/module/netcontrolintent.go +++ b/src/ncm/pkg/module/netcontrolintent.go @@ -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") } -- cgit 1.2.3-korg