store disk artifacts per image build instead of per compose
In #221 Compose was refactored: Now it can have multiple image builds. More image builds result in more jobs. Each job has its own result (logs from osbuild). Additionally, also targets are now a part of image build. With local target this effectively means we can have multiple images per compose. However, these artifacts (images & results) were stored only per compose prior this commit, thus rendering the behaviour of composes with multiple image builds undefined and racy. This commit fixes it by storing all the artifacts per image build instead of per compose. To achieve this feature, getComposeDirectory and getImageBuildDirectory methods were created to centralize the path assembly. Paths to artifacts prior this commit: ${COMPOSER_STATE_DIR}/outputs/${COMPOSE_ID}/* Paths to artifacts after this commit: ${COMPOSER_STATE_DIR}/outputs/${COMPOSE_ID}/${IMAGE_BUILD_ID}/*
This commit is contained in:
parent
b64bbaa0bb
commit
08c5eaf6a6
2 changed files with 23 additions and 14 deletions
|
|
@ -1652,7 +1652,7 @@ func (api *API) composeLogsHandler(writer http.ResponseWriter, request *http.Req
|
|||
return
|
||||
}
|
||||
|
||||
resultReader, err := api.store.GetComposeResult(id)
|
||||
resultReader, err := api.store.GetImageBuildResult(id, 0)
|
||||
|
||||
if err != nil {
|
||||
errors := responseError{
|
||||
|
|
@ -1737,7 +1737,7 @@ func (api *API) composeLogHandler(writer http.ResponseWriter, request *http.Requ
|
|||
return
|
||||
}
|
||||
|
||||
resultReader, err := api.store.GetComposeResult(id)
|
||||
resultReader, err := api.store.GetImageBuildResult(id, 0)
|
||||
|
||||
if err != nil {
|
||||
errors := responseError{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue