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/pkg/module/workloadifintent.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/pkg/module/workloadifintent.go')
-rw-r--r-- | src/ovnaction/pkg/module/workloadifintent.go | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/ovnaction/pkg/module/workloadifintent.go b/src/ovnaction/pkg/module/workloadifintent.go index 55062564..cea336f6 100644 --- a/src/ovnaction/pkg/module/workloadifintent.go +++ b/src/ovnaction/pkg/module/workloadifintent.go @@ -41,6 +41,7 @@ type WorkloadIfIntentKey struct { Project string `json:"provider"` CompositeApp string `json:"compositeapp"` CompositeAppVersion string `json:"compositeappversion"` + DigName string `json:"deploymentintentgroup"` NetControlIntent string `json:"netcontrolintent"` WorkloadIntent string `json:"workloadintent"` WorkloadIfIntent string `json:"workloadifintent"` @@ -48,10 +49,10 @@ type WorkloadIfIntentKey struct { // Manager is an interface exposing the WorkloadIfIntent functionality type WorkloadIfIntentManager interface { - CreateWorkloadIfIntent(wi WorkloadIfIntent, project, compositeapp, compositeappversion, netcontrolintent, workloadintent string, exists bool) (WorkloadIfIntent, error) - GetWorkloadIfIntent(name, project, compositeapp, compositeappversion, netcontrolintent, workloadintent string) (WorkloadIfIntent, error) - GetWorkloadIfIntents(project, compositeapp, compositeappversion, netcontrolintent, workloadintent string) ([]WorkloadIfIntent, error) - DeleteWorkloadIfIntent(name, project, compositeapp, compositeappversion, netcontrolintent, workloadintent string) error + CreateWorkloadIfIntent(wi WorkloadIfIntent, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string, exists bool) (WorkloadIfIntent, error) + GetWorkloadIfIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) (WorkloadIfIntent, error) + GetWorkloadIfIntents(project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) ([]WorkloadIfIntent, error) + DeleteWorkloadIfIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) error } // WorkloadIfIntentClient implements the Manager @@ -72,26 +73,27 @@ func NewWorkloadIfIntentClient() *WorkloadIfIntentClient { } // CreateWorkloadIfIntent - create a new WorkloadIfIntent -func (v *WorkloadIfIntentClient) CreateWorkloadIfIntent(wif WorkloadIfIntent, project, compositeapp, compositeappversion, netcontrolintent, workloadintent string, exists bool) (WorkloadIfIntent, error) { +func (v *WorkloadIfIntentClient) CreateWorkloadIfIntent(wif WorkloadIfIntent, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string, exists bool) (WorkloadIfIntent, error) { //Construct key and tag to select the entry key := WorkloadIfIntentKey{ Project: project, CompositeApp: compositeapp, CompositeAppVersion: compositeappversion, + DigName: dig, NetControlIntent: netcontrolintent, WorkloadIntent: workloadintent, WorkloadIfIntent: wif.Metadata.Name, } //Check if the Workload Intent exists - _, err := NewWorkloadIntentClient().GetWorkloadIntent(workloadintent, project, compositeapp, compositeappversion, netcontrolintent) + _, err := NewWorkloadIntentClient().GetWorkloadIntent(workloadintent, project, compositeapp, compositeappversion, dig, netcontrolintent) if err != nil { return WorkloadIfIntent{}, pkgerrors.Errorf("Workload Intent %v does not exist", workloadintent) } //Check if this WorkloadIfIntent already exists - _, err = v.GetWorkloadIfIntent(wif.Metadata.Name, project, compositeapp, compositeappversion, netcontrolintent, workloadintent) + _, err = v.GetWorkloadIfIntent(wif.Metadata.Name, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent) if err == nil && !exists { return WorkloadIfIntent{}, pkgerrors.New("WorkloadIfIntent already exists") } @@ -105,13 +107,14 @@ func (v *WorkloadIfIntentClient) CreateWorkloadIfIntent(wif WorkloadIfIntent, pr } // GetWorkloadIfIntent returns the WorkloadIfIntent for corresponding name -func (v *WorkloadIfIntentClient) GetWorkloadIfIntent(name, project, compositeapp, compositeappversion, netcontrolintent, workloadintent string) (WorkloadIfIntent, error) { +func (v *WorkloadIfIntentClient) GetWorkloadIfIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) (WorkloadIfIntent, error) { //Construct key and tag to select the entry key := WorkloadIfIntentKey{ Project: project, CompositeApp: compositeapp, CompositeAppVersion: compositeappversion, + DigName: dig, NetControlIntent: netcontrolintent, WorkloadIntent: workloadintent, WorkloadIfIntent: name, @@ -136,13 +139,14 @@ func (v *WorkloadIfIntentClient) GetWorkloadIfIntent(name, project, compositeapp } // GetWorkloadIfIntentList returns all of the WorkloadIfIntent for corresponding name -func (v *WorkloadIfIntentClient) GetWorkloadIfIntents(project, compositeapp, compositeappversion, netcontrolintent, workloadintent string) ([]WorkloadIfIntent, error) { +func (v *WorkloadIfIntentClient) GetWorkloadIfIntents(project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) ([]WorkloadIfIntent, error) { //Construct key and tag to select the entry key := WorkloadIfIntentKey{ Project: project, CompositeApp: compositeapp, CompositeAppVersion: compositeappversion, + DigName: dig, NetControlIntent: netcontrolintent, WorkloadIntent: workloadintent, WorkloadIfIntent: "", @@ -167,13 +171,14 @@ func (v *WorkloadIfIntentClient) GetWorkloadIfIntents(project, compositeapp, com } // Delete the WorkloadIfIntent from database -func (v *WorkloadIfIntentClient) DeleteWorkloadIfIntent(name, project, compositeapp, compositeappversion, netcontrolintent, workloadintent string) error { +func (v *WorkloadIfIntentClient) DeleteWorkloadIfIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) error { //Construct key and tag to select the entry key := WorkloadIfIntentKey{ Project: project, CompositeApp: compositeapp, CompositeAppVersion: compositeappversion, + DigName: dig, NetControlIntent: netcontrolintent, WorkloadIntent: workloadintent, WorkloadIfIntent: name, |