Added createdAt field to be set when created in workflow_manager

This commit is contained in:
Andrey Melnikov
2020-01-30 10:17:41 -08:00
parent 6fa397cdbd
commit c5986a0132
2 changed files with 8 additions and 5 deletions

View File

@@ -45,6 +45,7 @@ func (r *ResourceManager) CreateWorkflow(namespace string, workflow *model.Workf
}
workflow.Name = createdWorkflows[0].Name
workflow.CreatedAt = createdWorkflows[0].CreationTimestamp.UTC()
workflow.UID = string(createdWorkflows[0].ObjectMeta.UID)
workflow.WorkflowTemplate = workflowTemplate
// Manifests could get big, don't return them in this case.
@@ -80,6 +81,7 @@ func (r *ResourceManager) GetWorkflow(namespace, name string) (workflow *model.W
}
workflow = &model.Workflow{
UID: string(wf.UID),
CreatedAt: workflowTemplate.CreatedAt,
Name: wf.Name,
Status: string(status),
WorkflowTemplate: workflowTemplate,

View File

@@ -30,6 +30,7 @@ func apiWorkflow(wf *model.Workflow) (workflow *api.Workflow) {
if wf.WorkflowTemplate != nil {
workflow.WorkflowTemplate = &api.WorkflowTemplate{
Uid: wf.WorkflowTemplate.UID,
CreatedAt: wf.WorkflowTemplate.CreatedAt.UTC().Format(time.RFC3339),
Name: wf.WorkflowTemplate.Name,
Version: wf.WorkflowTemplate.Version,
Manifest: wf.WorkflowTemplate.Manifest,