mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
fix: format p2p preheat execution start_time and end_time to standard time format
Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
parent
37d161c141
commit
5833f5498c
@ -540,10 +540,10 @@ func convertExecutionToPayload(model *task.Execution) (*models.Execution, error)
|
||||
}
|
||||
|
||||
execution := &models.Execution{
|
||||
EndTime: model.EndTime.String(),
|
||||
EndTime: model.EndTime.Format(time.RFC3339),
|
||||
ExtraAttrs: model.ExtraAttrs,
|
||||
ID: model.ID,
|
||||
StartTime: model.StartTime.String(),
|
||||
StartTime: model.StartTime.Format(time.RFC3339),
|
||||
Status: model.Status,
|
||||
StatusMessage: model.StatusMessage,
|
||||
Trigger: model.Trigger,
|
||||
|
@ -320,11 +320,11 @@ func Test_convertExecutionToPayload(t *testing.T) {
|
||||
EndTime: time.Time{},
|
||||
},
|
||||
expect: &models.Execution{
|
||||
EndTime: "0001-01-01 00:00:00 +0000 UTC",
|
||||
EndTime: "0001-01-01T00:00:00Z",
|
||||
ExtraAttrs: nil,
|
||||
ID: 1,
|
||||
Metrics: nil,
|
||||
StartTime: "0001-01-01 00:00:00 +0000 UTC",
|
||||
StartTime: "0001-01-01T00:00:00Z",
|
||||
Status: "",
|
||||
StatusMessage: "",
|
||||
Trigger: "",
|
||||
|
Loading…
Reference in New Issue
Block a user