From 80107dc294c86a452c6108ffca6f281b4dbb9192 Mon Sep 17 00:00:00 2001 From: "Igor D.C" Date: Wed, 30 Sep 2020 21:30:06 +0000 Subject: Subtle refactoring in a few functions In DCM. Essentially refactored two different areas: - rename apply/terminate functions in module to clarify what they do - split gets from getAlls in API code of the 5 DCM resource types And cleaned up here and there. Issue-ID: MULTICLOUD-1143 Change-Id: I9b72c77ba34a1febd5df4a339e87968ddc4a7891 Signed-off-by: Igor D.C --- src/dcm/pkg/module/apply.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/dcm/pkg/module') diff --git a/src/dcm/pkg/module/apply.go b/src/dcm/pkg/module/apply.go index 0b370f4a..b5ef61c2 100644 --- a/src/dcm/pkg/module/apply.go +++ b/src/dcm/pkg/module/apply.go @@ -266,7 +266,7 @@ func queryDBAndSetRsyncInfo() (installappclient.RsyncInfo, error) { } /* -callRsyncInstall method shall take in the app context id and invokes the rsync service via grpc +callRsyncInstall method shall take in the app context id and invoke the rsync service via grpc */ func callRsyncInstall(contextid interface{}) error { rsyncInfo, err := queryDBAndSetRsyncInfo() @@ -286,7 +286,7 @@ func callRsyncInstall(contextid interface{}) error { } /* -callRsyncUninstall method shall take in the app context id and invokes the rsync service via grpc +callRsyncUninstall method shall take in the app context id and invoke the rsync service via grpc */ func callRsyncUninstall(contextid interface{}) error { rsyncInfo, err := queryDBAndSetRsyncInfo() @@ -305,7 +305,9 @@ func callRsyncUninstall(contextid interface{}) error { return nil } -func CreateEtcdContext(project string, logicalcloud LogicalCloud, clusterList []Cluster, +// Apply prepares all yaml resources to be given to the clusters via rsync, +// then creates an appcontext with such resources and asks rsync to apply the logical cloud +func Apply(project string, logicalcloud LogicalCloud, clusterList []Cluster, quotaList []Quota) error { APP := "logical-cloud" @@ -596,9 +598,9 @@ func CreateEtcdContext(project string, logicalcloud LogicalCloud, clusterList [] } -// TODO: rename these methods -// DestroyEtcdContext remove from rsync then delete appcontext and all resources -func DestroyEtcdContext(project string, logicalcloud LogicalCloud, clusterList []Cluster, +// Terminate asks rsync to terminate the logical cloud, then waits in the background until +// rsync claims the logical cloud is terminated, and then deletes the appcontext +func Terminate(project string, logicalcloud LogicalCloud, clusterList []Cluster, quotaList []Quota) error { logicalCloudName := logicalcloud.MetaData.LogicalCloudName -- cgit 1.2.3-korg