fix: deleting labels and getting labels for workflow execution

* Fixed issue where ReplaceLabels did not work when no labels were passed in (a delete essentially)
* Updated workflow execution to also get the labels
* Removed unusued GetResourceIdBuilder method.
This commit is contained in:
Andrey Melnikov
2020-05-17 13:25:08 -07:00
parent b9ccacc2ea
commit f8d7ec73ba
2 changed files with 9 additions and 23 deletions

View File

@@ -36,6 +36,7 @@ func apiWorkflowExecution(wf *v1.WorkflowExecution) (workflow *api.WorkflowExecu
Name: wf.Name,
Phase: string(wf.Phase),
Manifest: wf.Manifest,
Labels: converter.MappingToKeyValue(wf.Labels),
}
if wf.StartedAt != nil && !wf.StartedAt.IsZero() {
@@ -156,6 +157,14 @@ func (s *WorkflowServer) GetWorkflowExecution(ctx context.Context, req *api.GetW
return nil, err
}
mappedLabels, err := client.GetDbLabelsMapped(v1.TypeWorkflowExecution, wf.ID)
if err != nil {
return nil, err
}
if labels, ok := mappedLabels[wf.ID]; ok {
wf.Labels = labels
}
return apiWorkflowExecution(wf), nil
}