update: Workflow Template now gets a modifiedAt date, and total version count, from the the Get endpoint.

This commit is contained in:
Andrey Melnikov
2020-06-01 16:09:35 -07:00
parent 2726ec8d82
commit fa68d2bef4
5 changed files with 78 additions and 34 deletions

View File

@@ -31,6 +31,10 @@ func apiWorkflowTemplate(wft *v1.WorkflowTemplate) *api.WorkflowTemplate {
Labels: converter.MappingToKeyValue(wft.Labels),
}
if wft.ModifiedAt != nil {
res.ModifiedAt = wft.ModifiedAt.UTC().Format(time.RFC3339)
}
if wft.WorkflowExecutionStatisticReport != nil {
res.Stats = &api.WorkflowExecutionStatisticReport{
Total: wft.WorkflowExecutionStatisticReport.Total,
@@ -135,6 +139,12 @@ func (s *WorkflowTemplateServer) GetWorkflowTemplate(ctx context.Context, req *a
return nil, err
}
versionsCount, err := client.CountWorkflowTemplateVersions(req.Namespace, req.Uid)
if err != nil {
return nil, err
}
workflowTemplate.Versions = int64(versionsCount)
return apiWorkflowTemplate(workflowTemplate), nil
}