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:
Aleksandr Melnikov
2020-04-07 16:26:52 -07:00
parent 2f8c923fe8
commit 62f949de5f

View File

@@ -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