weldr: move common.ComposeState to weldr
ComposeState is only used by the weldr API. Drop the JSON marshaller and unmarshaller, because ComposeState is not used in an JSON-exported field anymore.
This commit is contained in:
parent
669b612d96
commit
bcd57a77e2
5 changed files with 62 additions and 67 deletions
|
|
@ -35,23 +35,23 @@ func composeToComposeEntry(id uuid.UUID, compose store.Compose, status *composeS
|
|||
}
|
||||
|
||||
switch status.State {
|
||||
case common.CWaiting:
|
||||
case CWaiting:
|
||||
composeEntry.QueueStatus = common.IBWaiting
|
||||
composeEntry.JobCreated = float64(status.Queued.UnixNano()) / 1000000000
|
||||
|
||||
case common.CRunning:
|
||||
case CRunning:
|
||||
composeEntry.QueueStatus = common.IBRunning
|
||||
composeEntry.JobCreated = float64(status.Queued.UnixNano()) / 1000000000
|
||||
composeEntry.JobStarted = float64(status.Started.UnixNano()) / 1000000000
|
||||
|
||||
case common.CFinished:
|
||||
case CFinished:
|
||||
composeEntry.QueueStatus = common.IBFinished
|
||||
composeEntry.ImageSize = compose.ImageBuild.Size
|
||||
composeEntry.JobCreated = float64(status.Queued.UnixNano()) / 1000000000
|
||||
composeEntry.JobStarted = float64(status.Started.UnixNano()) / 1000000000
|
||||
composeEntry.JobFinished = float64(status.Finished.UnixNano()) / 1000000000
|
||||
|
||||
case common.CFailed:
|
||||
case CFailed:
|
||||
composeEntry.QueueStatus = common.IBFailed
|
||||
composeEntry.JobCreated = float64(status.Queued.UnixNano()) / 1000000000
|
||||
composeEntry.JobStarted = float64(status.Started.UnixNano()) / 1000000000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue