mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-05 13:46:51 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user