From 3b6bc69c37fc42fd694d6dbb155ebc757b73e2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Fri, 15 May 2020 12:02:22 +0200 Subject: [PATCH] api/weldr: propagate the ComposeResult to ComposeStatus When a job doesn't exist for a compose, just return an empty result. In the future this will cause logs disappear from jobs created before the store-jobqueue split but we decided we can live with that, they are still in /var for those who really want them. --- internal/weldr/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/weldr/api.go b/internal/weldr/api.go index 479e163d5..178624b41 100644 --- a/internal/weldr/api.go +++ b/internal/weldr/api.go @@ -147,6 +147,7 @@ type composeStatus struct { Queued time.Time Started time.Time Finished time.Time + Result *common.ComposeResult } // Returns the state of the image in `compose` and the times the job was @@ -175,6 +176,7 @@ func (api *API) getComposeStatus(compose store.Compose) *composeStatus { Queued: compose.ImageBuild.JobCreated, Started: compose.ImageBuild.JobStarted, Finished: compose.ImageBuild.JobFinished, + Result: &common.ComposeResult{}, } } @@ -185,6 +187,7 @@ func (api *API) getComposeStatus(compose store.Compose) *composeStatus { Queued: jobStatus.Queued, Started: jobStatus.Started, Finished: jobStatus.Finished, + Result: jobStatus.Result.OSBuildOutput, } }