feat: Updated cron to return the active parameters

This commit is contained in:
Andrey Melnikov
2020-03-31 19:20:55 -07:00
parent 648ad4b694
commit 3fe93a64c9
12 changed files with 317 additions and 55 deletions

View File

@@ -202,6 +202,15 @@ func (c *Client) ListCronWorkflows(namespace string) (cronWorkflows []*CronWorkf
})
for _, cwf := range cwfs {
var parameters []WorkflowExecutionParameter
for _, param := range cwf.Spec.WorkflowSpec.Arguments.Parameters {
parameters = append(parameters, WorkflowExecutionParameter{
Name: param.Name,
Value: param.Value,
})
}
cronWorkflows = append(cronWorkflows, &CronWorkflow{
CreatedAt: cwf.CreationTimestamp.UTC(),
UID: string(cwf.ObjectMeta.UID),
@@ -213,7 +222,9 @@ func (c *Client) ListCronWorkflows(namespace string) (cronWorkflows []*CronWorkf
StartingDeadlineSeconds: cwf.Spec.StartingDeadlineSeconds,
SuccessfulJobsHistoryLimit: cwf.Spec.SuccessfulJobsHistoryLimit,
FailedJobsHistoryLimit: cwf.Spec.FailedJobsHistoryLimit,
WorkflowExecution: nil,
WorkflowExecution: &WorkflowExecution{
Parameters: parameters,
},
})
}
return