aboutsummaryrefslogtreecommitdiffstats
path: root/src/clm/pkg/cluster
diff options
context:
space:
mode:
authorEric Multanen <eric.w.multanen@intel.com>2020-09-10 00:05:47 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-10 00:05:47 +0000
commit798e8e087cbe91de4be96f290cf8a8073069fc2e (patch)
treeeb668ed60001a29cd2a23eca20cd616725d91b07 /src/clm/pkg/cluster
parentbca6932e54ff0495947d8a4f1862339a69d386f8 (diff)
parent6452065eb2d3b2f0926d16499e0ecedec2382422 (diff)
Merge "Changes to add state and retry logic to rsync"
Diffstat (limited to 'src/clm/pkg/cluster')
-rw-r--r--src/clm/pkg/cluster/cluster.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clm/pkg/cluster/cluster.go b/src/clm/pkg/cluster/cluster.go
index 26a9d6df..fb8768d6 100644
--- a/src/clm/pkg/cluster/cluster.go
+++ b/src/clm/pkg/cluster/cluster.go
@@ -19,6 +19,7 @@ package cluster
import (
"time"
+ "github.com/onap/multicloud-k8s/src/orchestrator/pkg/appcontext"
"github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/db"
mtypes "github.com/onap/multicloud-k8s/src/orchestrator/pkg/module/types"
"github.com/onap/multicloud-k8s/src/orchestrator/pkg/state"
@@ -423,6 +424,14 @@ func (v *ClusterClient) DeleteCluster(provider, name string) error {
// remove the app contexts associated with this cluster
if stateVal == state.StateEnum.Terminated {
+ // Verify that the appcontext has completed terminating
+ ctxid := state.GetLastContextIdFromStateInfo(s)
+ acStatus, err := state.GetAppContextStatus(ctxid)
+ if err == nil &&
+ !(acStatus.Status == appcontext.AppContextStatusEnum.Terminated || acStatus.Status == appcontext.AppContextStatusEnum.TerminateFailed) {
+ return pkgerrors.Errorf("Network intents for cluster have not completed terminating " + name)
+ }
+
for _, id := range state.GetContextIdsFromStateInfo(s) {
context, err := state.GetAppContextFromId(id)
if err != nil {