aboutsummaryrefslogtreecommitdiffstats
path: root/src/orchestrator/pkg/module/app_intent.go
diff options
context:
space:
mode:
authorRajamohan Raj <rajamohan.raj@intel.com>2020-04-15 18:45:47 +0000
committerRajamohan Raj <rajamohan.raj@intel.com>2020-04-17 23:33:04 +0000
commit6e0b4df46f51f9793f2d88626234edaaf9992403 (patch)
tree1c91022afe63ee3643ff5a1246a28236e5d33c32 /src/orchestrator/pkg/module/app_intent.go
parent1c3a22e3de0dd24b4161ae8b34794627620a208b (diff)
Added intentResolver
IntentResolver shall collect the clusterdetails for each of the app where it needs to be deployed. This shall be called by the instantiation code. Issue-ID: MULTICLOUD-1041 Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com> Change-Id: I7d29901e46a5349ef502786c187c1c88bea61a12
Diffstat (limited to 'src/orchestrator/pkg/module/app_intent.go')
-rw-r--r--src/orchestrator/pkg/module/app_intent.go33
1 files changed, 6 insertions, 27 deletions
diff --git a/src/orchestrator/pkg/module/app_intent.go b/src/orchestrator/pkg/module/app_intent.go
index 5f4acb4d..9da252e5 100644
--- a/src/orchestrator/pkg/module/app_intent.go
+++ b/src/orchestrator/pkg/module/app_intent.go
@@ -25,8 +25,8 @@ import (
"encoding/json"
"reflect"
+ gpic "github.com/onap/multicloud-k8s/src/orchestrator/pkg/gpic"
"github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/db"
-
pkgerrors "github.com/pkg/errors"
)
@@ -44,31 +44,10 @@ type MetaData struct {
UserData2 string `json:"userData2"`
}
-// AllOf consists of AnyOfArray and ClusterNames array
-type AllOf struct {
- ProviderName string `json:"provider-name,omitempty"`
- ClusterName string `json:"cluster-name,omitempty"`
- ClusterLabelName string `json:"cluster-label-name,omitempty"`
- AnyOfArray []AnyOf `json:"anyOf,omitempty"`
-}
-
-// AnyOf consists of Array of ProviderName & ClusterLabelNames
-type AnyOf struct {
- ProviderName string `json:"provider-name,omitempty"`
- ClusterName string `json:"cluster-name,omitempty"`
- ClusterLabelName string `json:"cluster-label-name,omitempty"`
-}
-
-// IntentStruc consists of AllOfArray and AnyOfArray
-type IntentStruc struct {
- AllOfArray []AllOf `json:"allOf,omitempty"`
- AnyOfArray []AnyOf `json:"anyOf,omitempty"`
-}
-
// SpecData consists of appName and intent
type SpecData struct {
- AppName string `json:"app-name"`
- Intent IntentStruc `json:"intent"`
+ AppName string `json:"app-name"`
+ Intent gpic.IntentStruc `json:"intent"`
}
// AppIntentManager is an interface which exposes the
@@ -112,9 +91,9 @@ type ApplicationsAndClusterInfo struct {
// AppClusterInfo is a type linking the app and the clusters
// on which they need to be installed.
type AppClusterInfo struct {
- Name string `json:"name"`
- AllOfArray []AllOf `json:"allOf,omitempty"`
- AnyOfArray []AnyOf `json:"anyOf,omitempty"`
+ Name string `json:"name"`
+ AllOfArray []gpic.AllOf `json:"allOf,omitempty"`
+ AnyOfArray []gpic.AnyOf `json:"anyOf,omitempty"`
}
// We will use json marshalling to convert to string to