mirror of
https://github.com/goharbor/harbor
synced 2025-04-22 20:56:02 +00:00
Keep CheckInAt time empty when it is empty (#17877)
Fixes #17860 Signed-off-by: stonezdj <daojunz@vmware.com> Signed-off-by: stonezdj <daojunz@vmware.com>
This commit is contained in:
parent
bcbfad632a
commit
80999f28ee
@ -86,16 +86,23 @@ func toWorkerResponse(wks []*jm.Worker) []*models.Worker {
|
|||||||
PoolID: w.PoolID,
|
PoolID: w.PoolID,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
startAtTime := covertTime(w.StartedAt)
|
var startAtTime, checkInAtTime *strfmt.DateTime
|
||||||
checkInAtTime := covertTime(w.CheckInAt)
|
if w.StartedAt != 0 {
|
||||||
|
t := covertTime(w.StartedAt)
|
||||||
|
startAtTime = &t
|
||||||
|
}
|
||||||
|
if w.CheckInAt != 0 {
|
||||||
|
t := covertTime(w.CheckInAt)
|
||||||
|
checkInAtTime = &t
|
||||||
|
}
|
||||||
workers = append(workers, &models.Worker{
|
workers = append(workers, &models.Worker{
|
||||||
ID: w.ID,
|
ID: w.ID,
|
||||||
JobName: w.JobName,
|
JobName: w.JobName,
|
||||||
JobID: w.JobID,
|
JobID: w.JobID,
|
||||||
PoolID: w.PoolID,
|
PoolID: w.PoolID,
|
||||||
Args: w.Args,
|
Args: w.Args,
|
||||||
StartAt: &startAtTime,
|
StartAt: startAtTime,
|
||||||
CheckinAt: &checkInAtTime,
|
CheckinAt: checkInAtTime,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user