mirror of
				https://github.com/onepanelio/onepanel.git
				synced 2025-10-31 16:56:19 +08:00 
			
		
		
		
	Fixed issue where dates were not being set on workflow executions
This commit is contained in:
		| @@ -453,6 +453,9 @@ func (c *Client) WatchWorkflowExecution(namespace, name string) (<-chan *Workflo | |||||||
| 				continue | 				continue | ||||||
| 			} | 			} | ||||||
| 			workflowWatcher <- &WorkflowExecution{ | 			workflowWatcher <- &WorkflowExecution{ | ||||||
|  | 				CreatedAt:  workflow.CreationTimestamp.UTC(), | ||||||
|  | 				StartedAt:  workflow.Status.StartedAt.UTC(), | ||||||
|  | 				FinishedAt: workflow.Status.FinishedAt.UTC(), | ||||||
| 				UID:        string(workflow.UID), | 				UID:        string(workflow.UID), | ||||||
| 				Name:       workflow.Name, | 				Name:       workflow.Name, | ||||||
| 				Manifest:   string(manifest), | 				Manifest:   string(manifest), | ||||||
|   | |||||||
| @@ -26,11 +26,16 @@ func apiWorkflowExecution(wf *v1.WorkflowExecution) (workflow *api.WorkflowExecu | |||||||
| 		Name:      wf.Name, | 		Name:      wf.Name, | ||||||
| 		Uid:       wf.UID, | 		Uid:       wf.UID, | ||||||
| 		Phase:     string(wf.Phase), | 		Phase:     string(wf.Phase), | ||||||
| 		StartedAt:  wf.CreatedAt.Format(time.RFC3339), |  | ||||||
| 		FinishedAt: wf.FinishedAt.Format(time.RFC3339), |  | ||||||
| 		Manifest:  wf.Manifest, | 		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 { | 	if wf.WorkflowTemplate != nil { | ||||||
| 		workflow.WorkflowTemplate = &api.WorkflowTemplate{ | 		workflow.WorkflowTemplate = &api.WorkflowTemplate{ | ||||||
| 			Uid:        wf.WorkflowTemplate.UID, | 			Uid:        wf.WorkflowTemplate.UID, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Andrey Melnikov
					Andrey Melnikov