cloudapi: Add artifact cleanup to delete handler

Related: RHEL-60120
This commit is contained in:
Brian C. Lane 2024-05-01 18:13:50 -07:00 committed by Tomáš Hozza
parent 56fc58cca3
commit b33f86783f
2 changed files with 7 additions and 0 deletions

View file

@ -345,6 +345,11 @@ func (h *apiHandlers) deleteComposeImpl(ctx echo.Context, jobId uuid.UUID) error
return HTTPErrorWithInternal(ErrorDeletingJob, err)
}
err = h.server.workers.CleanupArtifacts()
if err != nil {
return HTTPErrorWithInternal(ErrorDeletingArtifacts, err)
}
return ctx.JSON(http.StatusOK, ComposeDeleteStatus{
Href: fmt.Sprintf("/api/image-builder-composer/v2/composes/delete/%v", jobId),
Id: jobId.String(),