From c054ad56bc30e85fa83560db89fa72b3534b1639 Mon Sep 17 00:00:00 2001 From: "Igor D.C" Date: Tue, 29 Sep 2020 19:00:37 +0000 Subject: Use project name provided by API in DCM DCM apply/terminate code was still using a hardcoded "test-project" string for the project name that logical clouds should associate to. This simple patch makes DCM use the project name provided by the API. It also checks that the project exists before creating a Logical Cloud. Issue-ID: MULTICLOUD-1143 Change-Id: I05c8a2309ed07a7c96da30bf2461c43abaccc9d5 Signed-off-by: Igor D.C --- src/dcm/pkg/module/logicalcloud.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dcm/pkg/module/logicalcloud.go') diff --git a/src/dcm/pkg/module/logicalcloud.go b/src/dcm/pkg/module/logicalcloud.go index 61d7b7a5..49a2a639 100644 --- a/src/dcm/pkg/module/logicalcloud.go +++ b/src/dcm/pkg/module/logicalcloud.go @@ -73,7 +73,7 @@ type LogicalCloudManager interface { GetAll(project string) ([]LogicalCloud, error) Delete(project, name string) error Update(project, name string, c LogicalCloud) (LogicalCloud, error) - GetLogicalCloudContext(name string) (appcontext.AppContext, string, error) + GetLogicalCloudContext(project string, name string) (appcontext.AppContext, string, error) } // Interface facilitates unit testing by mocking functions @@ -236,11 +236,11 @@ func (v *LogicalCloudClient) Update(project, logicalCloudName string, c LogicalC } // GetClusterContext returns the AppContext for corresponding provider and name -func (v *LogicalCloudClient) GetLogicalCloudContext(name string) (appcontext.AppContext, string, error) { +func (v *LogicalCloudClient) GetLogicalCloudContext(project string, name string) (appcontext.AppContext, string, error) { //Construct key and tag to select the entry key := LogicalCloudKey{ LogicalCloudName: name, - Project: "test-project", // FIXME(igordc): temporary, need to do some rework in the LC structs + Project: project, } value, err := db.DBconn.Find(v.storeName, key, v.tagContext) -- cgit 1.2.3-korg