aboutsummaryrefslogtreecommitdiffstats
path: root/src/dcm/pkg/module/apply.go
diff options
context:
space:
mode:
authorIgor D.C <igor.duarte.cardoso@intel.com>2020-09-29 19:00:37 +0000
committerIgor D.C <igor.duarte.cardoso@intel.com>2020-09-29 23:45:47 +0000
commitc054ad56bc30e85fa83560db89fa72b3534b1639 (patch)
treebfb25754ac57ad9a3df89400f929fe40207f9d54 /src/dcm/pkg/module/apply.go
parentb069e7e63469a34e380e2a139aa2bfeaa9fb4c7f (diff)
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 <igor.duarte.cardoso@intel.com>
Diffstat (limited to 'src/dcm/pkg/module/apply.go')
-rw-r--r--src/dcm/pkg/module/apply.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/dcm/pkg/module/apply.go b/src/dcm/pkg/module/apply.go
index a866934a..0b370f4a 100644
--- a/src/dcm/pkg/module/apply.go
+++ b/src/dcm/pkg/module/apply.go
@@ -305,12 +305,11 @@ func callRsyncUninstall(contextid interface{}) error {
return nil
}
-func CreateEtcdContext(logicalcloud LogicalCloud, clusterList []Cluster,
+func CreateEtcdContext(project string, logicalcloud LogicalCloud, clusterList []Cluster,
quotaList []Quota) error {
APP := "logical-cloud"
logicalCloudName := logicalcloud.MetaData.LogicalCloudName
- project := "test-project" // FIXME(igordc): temporary, need to do some rework in the LC structs
//Resource Names
namespaceName := strings.Join([]string{logicalcloud.MetaData.LogicalCloudName, "+namespace"}, "")
@@ -599,13 +598,12 @@ func CreateEtcdContext(logicalcloud LogicalCloud, clusterList []Cluster,
// TODO: rename these methods
// DestroyEtcdContext remove from rsync then delete appcontext and all resources
-func DestroyEtcdContext(logicalcloud LogicalCloud, clusterList []Cluster,
+func DestroyEtcdContext(project string, logicalcloud LogicalCloud, clusterList []Cluster,
quotaList []Quota) error {
logicalCloudName := logicalcloud.MetaData.LogicalCloudName
- // project := "test-project" // FIXME(igordc): temporary, need to do some rework in the LC structs
- _, ctxVal, err := NewLogicalCloudClient().GetLogicalCloudContext(logicalCloudName)
+ _, ctxVal, err := NewLogicalCloudClient().GetLogicalCloudContext(project, logicalCloudName)
if err != nil {
return pkgerrors.Wrapf(err, "Error finding AppContext for Logical Cloud: %v", logicalCloudName)
}