summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Multanen <eric.w.multanen@intel.com>2020-03-20 12:34:18 -0700
committerRitu Sood <Ritu.Sood@intel.com>2020-03-23 22:41:05 +0000
commita4f31feda88ba8c5ac9e1cfb1ee78ef536475647 (patch)
treed2df9b5ae7439d8777b6981a20436aa17545c820 /src
parent529906640a6844dd371de37631e3948d328a390b (diff)
Sync up Key json attribute names
Sync up names used for the Key structures and tagMeta attribute names. This should ensure that the mongo db routines will query properly. Issue-ID: MULTICLOUD-1029 Signed-off-by: Eric Multanen <eric.w.multanen@intel.com> Change-Id: I05da9de92a22cb73d60a7349c3cc5bd4cedd99a5
Diffstat (limited to 'src')
-rw-r--r--src/orchestrator/pkg/module/add_intents.go6
-rw-r--r--src/orchestrator/pkg/module/app_intent.go8
-rw-r--r--src/orchestrator/pkg/module/app_intent_test.go6
-rw-r--r--src/orchestrator/pkg/module/app_test.go2
-rw-r--r--src/orchestrator/pkg/module/compositeapp.go6
-rw-r--r--src/orchestrator/pkg/module/compositeapp_test.go4
-rw-r--r--src/orchestrator/pkg/module/deployment_intent_groups.go6
-rw-r--r--src/orchestrator/pkg/module/deployment_intent_groups_test.go4
-rw-r--r--src/orchestrator/pkg/module/generic_placement_intent.go6
-rw-r--r--src/orchestrator/pkg/module/generic_placement_intent_test.go4
10 files changed, 26 insertions, 26 deletions
diff --git a/src/orchestrator/pkg/module/add_intents.go b/src/orchestrator/pkg/module/add_intents.go
index a657cce7..20fba189 100644
--- a/src/orchestrator/pkg/module/add_intents.go
+++ b/src/orchestrator/pkg/module/add_intents.go
@@ -64,11 +64,11 @@ type IntentManager interface {
// IntentKey consists of Name if the intent, Project name, CompositeApp name,
// CompositeApp version
type IntentKey struct {
- Name string `json:"name"`
+ Name string `json:"intentname"`
Project string `json:"project"`
CompositeApp string `json:"compositeapp"`
- Version string `json:"version"`
- DeploymentIntentGroup string `json:"deployment-intent-group-name"`
+ Version string `json:"compositeappversion"`
+ DeploymentIntentGroup string `json:"deploymentintentgroup"`
}
// We will use json marshalling to convert to string to
diff --git a/src/orchestrator/pkg/module/app_intent.go b/src/orchestrator/pkg/module/app_intent.go
index 70c80dac..a3f4b832 100644
--- a/src/orchestrator/pkg/module/app_intent.go
+++ b/src/orchestrator/pkg/module/app_intent.go
@@ -74,11 +74,11 @@ type AppIntentManager interface {
// AppIntentKey is used as primary key
type AppIntentKey struct {
- Name string `json:"name"`
+ Name string `json:"appintent"`
Project string `json:"project"`
CompositeApp string `json:"compositeapp"`
- Version string `json:"version"`
- Intent string `json:"intent-name"`
+ Version string `json:"compositeappversion"`
+ Intent string `json:"genericplacement"`
}
// We will use json marshalling to convert to string to
@@ -101,7 +101,7 @@ type AppIntentClient struct {
func NewAppIntentClient() *AppIntentClient {
return &AppIntentClient{
storeName: "orchestrator",
- tagMetaData: "appintent",
+ tagMetaData: "appintentmetadata",
}
}
diff --git a/src/orchestrator/pkg/module/app_intent_test.go b/src/orchestrator/pkg/module/app_intent_test.go
index fa2e4403..6cbdf15f 100644
--- a/src/orchestrator/pkg/module/app_intent_test.go
+++ b/src/orchestrator/pkg/module/app_intent_test.go
@@ -118,7 +118,7 @@ func TestCreateAppIntent(t *testing.T) {
},
CompositeAppKey{CompositeAppName: "testCompositeApp",
Version: "testCompositeAppVersion", Project: "testProject"}.String(): {
- "compositeapp": []byte(
+ "compositeappmetadata": []byte(
"{\"metadata\":{" +
"\"name\":\"testCompositeApp\"," +
"\"description\":\"description\"," +
@@ -134,7 +134,7 @@ func TestCreateAppIntent(t *testing.T) {
CompositeApp: "testCompositeApp",
Version: "testCompositeAppVersion",
}.String(): {
- "genericplacementintent": []byte(
+ "genericplacementintentmetadata": []byte(
"{\"metadata\":{\"Name\":\"testIntent\"," +
"\"Description\":\"A sample intent for testing\"," +
"\"UserData1\": \"userData1\"," +
@@ -222,7 +222,7 @@ func TestGetAppIntent(t *testing.T) {
Version: "testCompositeAppVersion",
Intent: "testIntent",
}.String(): {
- "appintent": []byte(
+ "appintentmetadata": []byte(
"{\"metadata\":{\"Name\":\"testAppIntent\"," +
"\"Description\":\"testAppIntent\"," +
"\"UserData1\": \"userData1\"," +
diff --git a/src/orchestrator/pkg/module/app_test.go b/src/orchestrator/pkg/module/app_test.go
index 42c08ef6..3bbbaf2f 100644
--- a/src/orchestrator/pkg/module/app_test.go
+++ b/src/orchestrator/pkg/module/app_test.go
@@ -77,7 +77,7 @@ func TestCreateApp(t *testing.T) {
"}"),
},
CompositeAppKey{CompositeAppName: "testCompositeApp", Version: "v1", Project: "testProject"}.String(): {
- "compositeapp": []byte(
+ "compositeappmetadata": []byte(
"{" +
"\"metadata\":{" +
"\"Name\":\"testCompositeApp\"," +
diff --git a/src/orchestrator/pkg/module/compositeapp.go b/src/orchestrator/pkg/module/compositeapp.go
index 59fbbab5..70502367 100644
--- a/src/orchestrator/pkg/module/compositeapp.go
+++ b/src/orchestrator/pkg/module/compositeapp.go
@@ -45,8 +45,8 @@ type CompositeAppSpec struct {
// CompositeAppKey is the key structure that is used in the database
type CompositeAppKey struct {
- CompositeAppName string `json:"compositeappname"`
- Version string `json:"version"`
+ CompositeAppName string `json:"compositeapp"`
+ Version string `json:"compositeappversion"`
Project string `json:"project"`
}
@@ -79,7 +79,7 @@ type CompositeAppClient struct {
func NewCompositeAppClient() *CompositeAppClient {
return &CompositeAppClient{
storeName: "orchestrator",
- tagMeta: "compositeapp",
+ tagMeta: "compositeappmetadata",
}
}
diff --git a/src/orchestrator/pkg/module/compositeapp_test.go b/src/orchestrator/pkg/module/compositeapp_test.go
index a1a2ec1d..1fc5f5d2 100644
--- a/src/orchestrator/pkg/module/compositeapp_test.go
+++ b/src/orchestrator/pkg/module/compositeapp_test.go
@@ -132,7 +132,7 @@ func TestGetCompositeApp(t *testing.T) {
mockdb: &db.MockDB{
Items: map[string]map[string][]byte{
CompositeAppKey{CompositeAppName: "testCompositeApp", Version: "v1", Project: "testProject"}.String(): {
- "compositeapp": []byte(
+ "compositeappmetadata": []byte(
"{" +
"\"metadata\":{" +
"\"Name\":\"testCompositeApp\"," +
@@ -195,7 +195,7 @@ func TestDeleteCompositeApp(t *testing.T) {
mockdb: &db.MockDB{
Items: map[string]map[string][]byte{
CompositeAppKey{CompositeAppName: "testCompositeApp", Version: "v1", Project: "testProject"}.String(): {
- "compositeapp": []byte(
+ "compositeappmetadata": []byte(
"{" +
"\"metadata\":{" +
"\"Name\":\"testCompositeApp\"," +
diff --git a/src/orchestrator/pkg/module/deployment_intent_groups.go b/src/orchestrator/pkg/module/deployment_intent_groups.go
index fe622771..cfbf53e2 100644
--- a/src/orchestrator/pkg/module/deployment_intent_groups.go
+++ b/src/orchestrator/pkg/module/deployment_intent_groups.go
@@ -65,10 +65,10 @@ type DeploymentIntentGroupManager interface {
// DeploymentIntentGroupKey consists of Name of the deployment group, project name, CompositeApp name, CompositeApp version
type DeploymentIntentGroupKey struct {
- Name string `json:"name"`
+ Name string `json:"deploymentintentgroup"`
Project string `json:"project"`
CompositeApp string `json:"compositeapp"`
- Version string `json:"version"`
+ Version string `json:"compositeappversion"`
}
// We will use json marshalling to convert to string to
@@ -91,7 +91,7 @@ type DeploymentIntentGroupClient struct {
func NewDeploymentIntentGroupClient() *DeploymentIntentGroupClient {
return &DeploymentIntentGroupClient{
storeName: "orchestrator",
- tagMetaData: "deploymentintentgroup",
+ tagMetaData: "deploymentintentgroupmetadata",
}
}
diff --git a/src/orchestrator/pkg/module/deployment_intent_groups_test.go b/src/orchestrator/pkg/module/deployment_intent_groups_test.go
index 13dafd12..0fdeb4a1 100644
--- a/src/orchestrator/pkg/module/deployment_intent_groups_test.go
+++ b/src/orchestrator/pkg/module/deployment_intent_groups_test.go
@@ -94,7 +94,7 @@ func TestCreateDeploymentIntentGroup(t *testing.T) {
},
CompositeAppKey{CompositeAppName: "testCompositeApp",
Version: "testCompositeAppVersion", Project: "testProject"}.String(): {
- "compositeapp": []byte(
+ "compositeappmetadata": []byte(
"{\"metadata\":{" +
"\"name\":\"testCompositeApp\"," +
"\"description\":\"description\"," +
@@ -178,7 +178,7 @@ func TestGetDeploymentIntentGroup(t *testing.T) {
CompositeApp: "testCompositeApp",
Version: "testCompositeAppVersion",
}.String(): {
- "deploymentintentgroup": []byte(
+ "deploymentintentgroupmetadata": []byte(
"{\"metadata\":{\"name\":\"testDeploymentIntentGroup\"," +
"\"description\":\"DescriptionTestDeploymentIntentGroup\"," +
"\"userData1\": \"userData1\"," +
diff --git a/src/orchestrator/pkg/module/generic_placement_intent.go b/src/orchestrator/pkg/module/generic_placement_intent.go
index 8e739fc8..73849474 100644
--- a/src/orchestrator/pkg/module/generic_placement_intent.go
+++ b/src/orchestrator/pkg/module/generic_placement_intent.go
@@ -54,10 +54,10 @@ type GenericPlacementIntentManager interface {
// GenericPlacementIntentKey is used as the primary key
type GenericPlacementIntentKey struct {
- Name string `json:"name"`
+ Name string `json:"genericplacement"`
Project string `json:"project"`
CompositeApp string `json:"compositeapp"`
- Version string `json:"version"`
+ Version string `json:"compositeappversion"`
}
// We will use json marshalling to convert to string to
@@ -80,7 +80,7 @@ type GenericPlacementIntentClient struct {
func NewGenericPlacementIntentClient() *GenericPlacementIntentClient {
return &GenericPlacementIntentClient{
storeName: "orchestrator",
- tagMetaData: "genericplacementintent",
+ tagMetaData: "genericplacementintentmetadata",
}
}
diff --git a/src/orchestrator/pkg/module/generic_placement_intent_test.go b/src/orchestrator/pkg/module/generic_placement_intent_test.go
index 7121e055..d779e81f 100644
--- a/src/orchestrator/pkg/module/generic_placement_intent_test.go
+++ b/src/orchestrator/pkg/module/generic_placement_intent_test.go
@@ -72,7 +72,7 @@ func TestCreateGenericPlacementIntent(t *testing.T) {
},
CompositeAppKey{CompositeAppName: "testCompositeApp",
Version: "testCompositeAppVersion", Project: "testProject"}.String(): {
- "compositeapp": []byte(
+ "compositeappmetadata": []byte(
"{\"metadata\":{" +
"\"name\":\"testCompositeApp\"," +
"\"description\":\"description\"," +
@@ -147,7 +147,7 @@ func TestGetGenericPlacementIntent(t *testing.T) {
CompositeApp: "testCompositeApp",
Version: "testVersion",
}.String(): {
- "genericplacementintent": []byte(
+ "genericplacementintentmetadata": []byte(
"{\"metadata\":{\"Name\":\"testIntent\"," +
"\"Description\":\"A sample intent for testing\"," +
"\"UserData1\": \"userData1\"," +