mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-17 03:00:36 +08:00
Adjusting labels logic so that they merge together.
- Need labels from CronWorkflow passed into Workflow, so they can relate and thus show up in the UI
This commit is contained in:
@@ -408,6 +408,13 @@ func (c *Client) createCronWorkflow(namespace string, wf *wfv1.Workflow, cwf *wf
|
||||
}
|
||||
cwf.Spec.WorkflowSpec = wf.Spec
|
||||
cwf.Spec.WorkflowMetadata = &wf.ObjectMeta
|
||||
|
||||
//merge the labels
|
||||
mergedLabels := wf.ObjectMeta.Labels
|
||||
for k, v := range *opts.Labels {
|
||||
mergedLabels[k] = v
|
||||
}
|
||||
cwf.Spec.WorkflowMetadata.Labels = mergedLabels
|
||||
createdCronWorkflow, err = c.ArgoprojV1alpha1().CronWorkflows(namespace).Create(cwf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user