diff options
author | Igor D.C <igor.duarte.cardoso@intel.com> | 2020-09-30 21:30:06 +0000 |
---|---|---|
committer | Igor D.C <igor.duarte.cardoso@intel.com> | 2020-10-01 17:20:15 +0000 |
commit | 80107dc294c86a452c6108ffca6f281b4dbb9192 (patch) | |
tree | c246b3a46307dc851a8a2866655609d42e210c23 /src/dcm/pkg/module | |
parent | 5e114cd8a05986b7762fb9db22a43d61bb9fe00e (diff) |
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 <igor.duarte.cardoso@intel.com>
Diffstat (limited to 'src/dcm/pkg/module')
-rw-r--r-- | src/dcm/pkg/module/apply.go | 14 |
1 files changed, 8 insertions, 6 deletions
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 |