api: return actual logs in /compose/logs
Commit b1c5ef2a introduced support for retrieving logs from osbuild.
This commit finishes the second part - actually returning the logs
from /compose/logs route.
This commit is contained in:
parent
fb14c2c2c8
commit
665a7d81a8
4 changed files with 113 additions and 6 deletions
|
|
@ -3,10 +3,12 @@
|
|||
package store
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
|
@ -434,6 +436,13 @@ func (s *Store) GetAllComposes() map[uuid.UUID]Compose {
|
|||
return composes
|
||||
}
|
||||
|
||||
func (s *Store) GetComposeResult(id uuid.UUID) (io.ReadCloser, error) {
|
||||
if s.stateDir == nil {
|
||||
return ioutil.NopCloser(bytes.NewBuffer([]byte("{}"))), nil
|
||||
}
|
||||
return os.Open(*s.stateDir + "/outputs/" + id.String() + "/result.json")
|
||||
}
|
||||
|
||||
func (s *Store) PushCompose(composeID uuid.UUID, bp *blueprint.Blueprint, checksums map[string]string, arch, composeType string, uploadTarget *target.Target) error {
|
||||
targets := []*target.Target{}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue