store: remove the last traces of result.json
GetImageBuildResult() method is not called anywhere, so we can drop it. As it was the only reader of result.json file, we can also drop all the code which wrote to that file.
This commit is contained in:
parent
8a25d045d9
commit
eadd9be306
1 changed files with 0 additions and 29 deletions
|
|
@ -3,15 +3,12 @@
|
|||
package store
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"sort"
|
||||
|
|
@ -342,14 +339,6 @@ func (s *Store) GetAllComposes() map[uuid.UUID]Compose {
|
|||
return composes
|
||||
}
|
||||
|
||||
func (s *Store) GetImageBuildResult(composeId uuid.UUID) (io.ReadCloser, error) {
|
||||
if s.stateDir == nil {
|
||||
return ioutil.NopCloser(bytes.NewBuffer([]byte("{}"))), nil
|
||||
}
|
||||
|
||||
return os.Open(s.getImageBuildDirectory(composeId) + "/result.json")
|
||||
}
|
||||
|
||||
func (s *Store) GetImageBuildImage(composeId uuid.UUID) (io.ReadCloser, int64, error) {
|
||||
c, ok := s.composes[composeId]
|
||||
|
||||
|
|
@ -433,24 +422,6 @@ func (s *Store) PushTestCompose(composeID uuid.UUID, manifest *osbuild.Manifest,
|
|||
targets = []*target.Target{}
|
||||
}
|
||||
|
||||
if s.stateDir != nil {
|
||||
outputDir := s.getImageBuildDirectory(composeID)
|
||||
|
||||
err := os.MkdirAll(outputDir, 0755)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot create output directory for job %v: %#v", composeID, err)
|
||||
}
|
||||
|
||||
f, err := os.Create(s.getImageBuildDirectory(composeID) + "/result.json")
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot open result.json for job %v: %#v", composeID, err)
|
||||
}
|
||||
err = json.NewEncoder(f).Encode(common.ComposeResult{Success: testSuccess})
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot write to result.json for job %v: %#v", composeID, err)
|
||||
}
|
||||
}
|
||||
|
||||
var status common.ImageBuildState
|
||||
if testSuccess {
|
||||
status = common.IBFinished
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue