move injectAutomatedFields after exit and init handlers

This commit is contained in:
rushtehrani
2020-04-29 09:37:04 -07:00
parent 41e4ff6b2c
commit 772f6ce880

View File

@@ -362,9 +362,6 @@ func (c *Client) updateCronWorkflow(namespace string, name string, workflowTempl
if opts.Labels != nil { if opts.Labels != nil {
cwf.ObjectMeta.Labels = *opts.Labels cwf.ObjectMeta.Labels = *opts.Labels
} }
if err = c.injectAutomatedFields(namespace, wf, opts); err != nil {
return nil, err
}
err = injectExitHandlerWorkflowExecutionStatistic(wf, namespace, workflowTemplateId) err = injectExitHandlerWorkflowExecutionStatistic(wf, namespace, workflowTemplateId)
if err != nil { if err != nil {
@@ -374,6 +371,9 @@ func (c *Client) updateCronWorkflow(namespace string, name string, workflowTempl
if err != nil { if err != nil {
return nil, err return nil, err
} }
if err = c.injectAutomatedFields(namespace, wf, opts); err != nil {
return nil, err
}
cwf.Spec.WorkflowSpec = wf.Spec cwf.Spec.WorkflowSpec = wf.Spec
cwf.Spec.WorkflowMetadata = &wf.ObjectMeta cwf.Spec.WorkflowMetadata = &wf.ObjectMeta