mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-20 20:25:16 +08:00
Added createdAt field to be set when created in workflow_manager
This commit is contained in:
@@ -45,6 +45,7 @@ func (r *ResourceManager) CreateWorkflow(namespace string, workflow *model.Workf
|
|||||||
}
|
}
|
||||||
|
|
||||||
workflow.Name = createdWorkflows[0].Name
|
workflow.Name = createdWorkflows[0].Name
|
||||||
|
workflow.CreatedAt = createdWorkflows[0].CreationTimestamp.UTC()
|
||||||
workflow.UID = string(createdWorkflows[0].ObjectMeta.UID)
|
workflow.UID = string(createdWorkflows[0].ObjectMeta.UID)
|
||||||
workflow.WorkflowTemplate = workflowTemplate
|
workflow.WorkflowTemplate = workflowTemplate
|
||||||
// Manifests could get big, don't return them in this case.
|
// 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{
|
workflow = &model.Workflow{
|
||||||
UID: string(wf.UID),
|
UID: string(wf.UID),
|
||||||
|
CreatedAt: workflowTemplate.CreatedAt,
|
||||||
Name: wf.Name,
|
Name: wf.Name,
|
||||||
Status: string(status),
|
Status: string(status),
|
||||||
WorkflowTemplate: workflowTemplate,
|
WorkflowTemplate: workflowTemplate,
|
||||||
|
@@ -30,6 +30,7 @@ func apiWorkflow(wf *model.Workflow) (workflow *api.Workflow) {
|
|||||||
if wf.WorkflowTemplate != nil {
|
if wf.WorkflowTemplate != nil {
|
||||||
workflow.WorkflowTemplate = &api.WorkflowTemplate{
|
workflow.WorkflowTemplate = &api.WorkflowTemplate{
|
||||||
Uid: wf.WorkflowTemplate.UID,
|
Uid: wf.WorkflowTemplate.UID,
|
||||||
|
CreatedAt: wf.WorkflowTemplate.CreatedAt.UTC().Format(time.RFC3339),
|
||||||
Name: wf.WorkflowTemplate.Name,
|
Name: wf.WorkflowTemplate.Name,
|
||||||
Version: wf.WorkflowTemplate.Version,
|
Version: wf.WorkflowTemplate.Version,
|
||||||
Manifest: wf.WorkflowTemplate.Manifest,
|
Manifest: wf.WorkflowTemplate.Manifest,
|
||||||
|
Reference in New Issue
Block a user