From 1fc90f15489ae3eafeb5994f5285f09750feae4c Mon Sep 17 00:00:00 2001 From: Eric Multanen Date: Wed, 30 Sep 2020 22:38:59 -0700 Subject: Ovnaction and vfw updates for deploy api change Update the ovnaction controller APIs to support the api change of including the deployment intent group in the URL. Also fixup: - vfw and other test cases to support the change - updates to emcoctl tool and examples Issue-ID: MULTICLOUD-1218 Signed-off-by: Eric Multanen Change-Id: Icadacb5ec6d7c238bb3bf8a44a39c30692ecebee --- src/orchestrator/pkg/module/app_intent.go | 78 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'src/orchestrator/pkg/module/app_intent.go') diff --git a/src/orchestrator/pkg/module/app_intent.go b/src/orchestrator/pkg/module/app_intent.go index f2f4e070..6b394513 100644 --- a/src/orchestrator/pkg/module/app_intent.go +++ b/src/orchestrator/pkg/module/app_intent.go @@ -67,22 +67,22 @@ type AppIntentQueryKey struct { // AppIntentKey is used as primary key type AppIntentKey struct { - Name string `json:"appintent"` - Project string `json:"project"` - CompositeApp string `json:"compositeapp"` - Version string `json:"compositeappversion"` - Intent string `json:"genericplacement"` - DeploymentIntentGroupName string `json:"deploymentintentgroupname"` + Name string `json:"appintent"` + Project string `json:"project"` + CompositeApp string `json:"compositeapp"` + Version string `json:"compositeappversion"` + Intent string `json:"genericplacement"` + DeploymentIntentGroupName string `json:"deploymentintentgroup"` } // AppIntentFindByAppKey required for query type AppIntentFindByAppKey struct { - Project string `json:"project"` - CompositeApp string `json:"compositeapp"` - CompositeAppVersion string `json:"compositeappversion"` - Intent string `json:"genericplacement"` - DeploymentIntentGroupName string `json:"deploymentintentgroupname"` - AppName string `json:"app-name"` + Project string `json:"project"` + CompositeApp string `json:"compositeapp"` + CompositeAppVersion string `json:"compositeappversion"` + Intent string `json:"genericplacement"` + DeploymentIntentGroupName string `json:"deploymentintentgroup"` + AppName string `json:"app-name"` } // ApplicationsAndClusterInfo type represents the list of @@ -151,17 +151,17 @@ func (c *AppIntentClient) CreateAppIntent(a AppIntent, p string, ca string, v st } // check if the deploymentIntentGrpName exists - _, err = NewDeploymentIntentGroupClient().GetDeploymentIntentGroup(digName,p, ca, v) + _, err = NewDeploymentIntentGroupClient().GetDeploymentIntentGroup(digName, p, ca, v) if err != nil { return AppIntent{}, pkgerrors.New("Unable to find the deployment-intent-group-name") } akey := AppIntentKey{ - Name: a.MetaData.Name, - Project: p, - CompositeApp: ca, - Version: v, - Intent: i, + Name: a.MetaData.Name, + Project: p, + CompositeApp: ca, + Version: v, + Intent: i, DeploymentIntentGroupName: digName, } @@ -173,7 +173,7 @@ func (c *AppIntentClient) CreateAppIntent(a AppIntent, p string, ca string, v st if err != nil { return AppIntent{}, pkgerrors.Wrap(err, "Create DB entry error") } - + return a, nil } @@ -181,11 +181,11 @@ func (c *AppIntentClient) CreateAppIntent(a AppIntent, p string, ca string, v st func (c *AppIntentClient) GetAppIntent(ai string, p string, ca string, v string, i string, digName string) (AppIntent, error) { k := AppIntentKey{ - Name: ai, - Project: p, - CompositeApp: ca, - Version: v, - Intent: i, + Name: ai, + Project: p, + CompositeApp: ca, + Version: v, + Intent: i, DeploymentIntentGroupName: digName, } @@ -213,12 +213,12 @@ all the intents for the app. */ func (c *AppIntentClient) GetAllIntentsByApp(aN, p, ca, v, i, digName string) (SpecData, error) { k := AppIntentFindByAppKey{ - Project: p, - CompositeApp: ca, - CompositeAppVersion: v, - Intent: i, + Project: p, + CompositeApp: ca, + CompositeAppVersion: v, + Intent: i, DeploymentIntentGroupName: digName, - AppName: aN, + AppName: aN, } result, err := db.DBconn.Find(c.storeName, k, c.tagMetaData) if err != nil { @@ -239,11 +239,11 @@ and GenericPlacementIntentName,DeploymentIntentGroupName. Returns the Applicatio */ func (c *AppIntentClient) GetAllAppIntents(p, ca, v, i, digName string) (ApplicationsAndClusterInfo, error) { k := AppIntentKey{ - Name: "", - Project: p, - CompositeApp: ca, - Version: v, - Intent: i, + Name: "", + Project: p, + CompositeApp: ca, + Version: v, + Intent: i, DeploymentIntentGroupName: digName, } result, err := db.DBconn.Find(c.storeName, k, c.tagMetaData) @@ -276,11 +276,11 @@ func (c *AppIntentClient) GetAllAppIntents(p, ca, v, i, digName string) (Applica // DeleteAppIntent delete an AppIntent func (c *AppIntentClient) DeleteAppIntent(ai string, p string, ca string, v string, i string, digName string) error { k := AppIntentKey{ - Name: ai, - Project: p, - CompositeApp: ca, - Version: v, - Intent: i, + Name: ai, + Project: p, + CompositeApp: ca, + Version: v, + Intent: i, DeploymentIntentGroupName: digName, } -- cgit 1.2.3-korg