Fixed issue where dates were not being set on workflow executions

This commit is contained in:
Andrey Melnikov
2020-03-02 15:19:39 -08:00
parent 7e8c40f0b7
commit ea04a661b3
2 changed files with 18 additions and 10 deletions

View File

@@ -453,6 +453,9 @@ func (c *Client) WatchWorkflowExecution(namespace, name string) (<-chan *Workflo
continue
}
workflowWatcher <- &WorkflowExecution{
CreatedAt: workflow.CreationTimestamp.UTC(),
StartedAt: workflow.Status.StartedAt.UTC(),
FinishedAt: workflow.Status.FinishedAt.UTC(),
UID: string(workflow.UID),
Name: workflow.Name,
Manifest: string(manifest),

View File

@@ -26,11 +26,16 @@ func apiWorkflowExecution(wf *v1.WorkflowExecution) (workflow *api.WorkflowExecu
Name: wf.Name,
Uid: wf.UID,
Phase: string(wf.Phase),
StartedAt: wf.CreatedAt.Format(time.RFC3339),
FinishedAt: wf.FinishedAt.Format(time.RFC3339),
Manifest: wf.Manifest,
}
if !wf.StartedAt.IsZero() {
workflow.StartedAt = wf.StartedAt.Format(time.RFC3339)
}
if !wf.FinishedAt.IsZero() {
workflow.FinishedAt = wf.FinishedAt.Format(time.RFC3339)
}
if wf.WorkflowTemplate != nil {
workflow.WorkflowTemplate = &api.WorkflowTemplate{
Uid: wf.WorkflowTemplate.UID,