fix(server): Upload symlink layer created by first Nix build

This layer is needed in addition to those that are built in the second
Nix build.
This commit is contained in:
Vincent Ambo 2019-10-02 15:31:57 +01:00 committed by Vincent Ambo
parent f4f2909573
commit 64fca61ea1

View file

@ -63,7 +63,10 @@ type Image struct {
Packages []string Packages []string
} }
// TODO(tazjin): docstring // BuildResult represents the data returned from the server to the
// HTTP handlers. Error information is propagated straight from Nix
// for errors inside of the build that should be fed back to the
// client (such as missing packages).
type BuildResult struct { type BuildResult struct {
Error string `json:"error"` Error string `json:"error"`
Pkgs []string `json:"pkgs"` Pkgs []string `json:"pkgs"`
@ -382,6 +385,8 @@ func BuildImage(ctx context.Context, s *State, image *Image) (*BuildResult, erro
return nil, err return nil, err
} }
layerResult[imageResult.SymlinkLayer.SHA256] = imageResult.SymlinkLayer.Path
layers := []manifest.Entry{} layers := []manifest.Entry{}
for key, path := range layerResult { for key, path := range layerResult {
f, err := os.Open(path) f, err := os.Open(path)