diff options
author | Eric Multanen <eric.w.multanen@intel.com> | 2020-09-30 22:38:59 -0700 |
---|---|---|
committer | Eric Multanen <eric.w.multanen@intel.com> | 2020-10-02 23:41:52 -0700 |
commit | 1fc90f15489ae3eafeb5994f5285f09750feae4c (patch) | |
tree | bb42ac610b2fbc13e5cfc746bb32f3b8ccabd2b3 /src/ovnaction/internal/action/action.go | |
parent | d4b89af411ec7444b554a8b0ddeb7e239fa0fc73 (diff) |
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 <eric.w.multanen@intel.com>
Change-Id: Icadacb5ec6d7c238bb3bf8a44a39c30692ecebee
Diffstat (limited to 'src/ovnaction/internal/action/action.go')
-rw-r--r-- | src/ovnaction/internal/action/action.go | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/ovnaction/internal/action/action.go b/src/ovnaction/internal/action/action.go index c9b912fa..ae04cb0f 100644 --- a/src/ovnaction/internal/action/action.go +++ b/src/ovnaction/internal/action/action.go @@ -47,11 +47,12 @@ func UpdateAppContext(intentName, appContextId string) error { project := caMeta.Project compositeapp := caMeta.CompositeApp compositeappversion := caMeta.Version + deployIntentGroup := caMeta.DeploymentIntentGroup // Handle all Workload Intents for the Network Control Intent - wis, err := module.NewWorkloadIntentClient().GetWorkloadIntents(project, compositeapp, compositeappversion, intentName) + wis, err := module.NewWorkloadIntentClient().GetWorkloadIntents(project, compositeapp, compositeappversion, deployIntentGroup, intentName) if err != nil { - return pkgerrors.Wrapf(err, "Error getting Workload Intents for Network Control Intent %v for %v/%v%v not found", intentName, project, compositeapp, compositeappversion) + return pkgerrors.Wrapf(err, "Error getting Workload Intents for Network Control Intent %v for %v/%v%v/%v not found", intentName, project, compositeapp, deployIntentGroup, compositeappversion) } // Handle all intents (currently just Workload Interface intents) for each Workload Intent @@ -66,20 +67,22 @@ func UpdateAppContext(intentName, appContextId string) error { wifs, err := module.NewWorkloadIfIntentClient().GetWorkloadIfIntents(project, compositeapp, compositeappversion, + deployIntentGroup, intentName, wi.Metadata.Name) if err != nil { return pkgerrors.Wrapf(err, - "Error getting Workload Interface Intents for Workload Intent %v under Network Control Intent %v for %v/%v%v not found", - wi.Metadata.Name, intentName, project, compositeapp, compositeappversion) + "Error getting Workload Interface Intents for Workload Intent %v under Network Control Intent %v for %v/%v%v/%v not found", + wi.Metadata.Name, intentName, project, compositeapp, compositeappversion, deployIntentGroup) } if len(wifs) == 0 { log.Warn("No interface intents provided for workload intent", log.Fields{ - "project": project, - "composite app": compositeapp, - "composite app version": compositeappversion, - "network control intent": intentName, - "workload intent": wi.Metadata.Name, + "project": project, + "composite app": compositeapp, + "composite app version": compositeappversion, + "deployment intent group": deployIntentGroup, + "network control intent": intentName, + "workload intent": wi.Metadata.Name, }) continue } @@ -91,14 +94,15 @@ func UpdateAppContext(intentName, appContextId string) error { strings.Join([]string{wi.Spec.WorkloadResource, wi.Spec.Type}, "+")) if err != nil { log.Warn("App Context resource handle not found", log.Fields{ - "project": project, - "composite app": compositeapp, - "composite app version": compositeappversion, - "network control intent": intentName, - "workload name": wi.Metadata.Name, - "app": wi.Spec.AppName, - "resource": wi.Spec.WorkloadResource, - "resource type": wi.Spec.Type, + "project": project, + "composite app": compositeapp, + "composite app version": compositeappversion, + "deployment intent group": deployIntentGroup, + "network control intent": intentName, + "workload name": wi.Metadata.Name, + "app": wi.Spec.AppName, + "resource": wi.Spec.WorkloadResource, + "resource type": wi.Spec.Type, }) continue } |