drop the Compose.Image field

Everything that this field contained can be computed in another way:

- path: just lookup the local target and read the path from there
- mime: can be derived from distribution and compose output type
- size: can be derived from the path

Therefore it imho doesn't make much sense to store these information multiple
times.
This commit is contained in:
Ondřej Budai 2020-02-12 14:54:01 +01:00 committed by Tom Gundersen
parent a9633d29e9
commit cc00e0cdc9
6 changed files with 68 additions and 66 deletions

View file

@ -94,12 +94,12 @@ func (api *API) addJobHandler(writer http.ResponseWriter, request *http.Request,
writer.WriteHeader(http.StatusCreated)
// FIXME: handle or comment this possible error
_ = json.NewEncoder(writer).Encode(Job{
ID: nextJob.ComposeID,
ID: nextJob.ComposeID,
ImageBuildID: nextJob.ImageBuildID,
Distro: nextJob.Distro,
Pipeline: nextJob.Pipeline,
Targets: nextJob.Targets,
OutputType: nextJob.ImageType,
Distro: nextJob.Distro,
Pipeline: nextJob.Pipeline,
Targets: nextJob.Targets,
OutputType: nextJob.ImageType,
})
}
@ -123,7 +123,7 @@ func (api *API) updateJobHandler(writer http.ResponseWriter, request *http.Reque
return
}
err = api.store.UpdateImageBuildInCompose(id, body.ImageBuildID, body.Status, body.Image, body.Result)
err = api.store.UpdateImageBuildInCompose(id, body.ImageBuildID, body.Status, body.Result)
if err != nil {
switch err.(type) {
case *store.NotFoundError: