From 796ff086bea3e060e61d8c56d38441898025ed1c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 13 May 2022 17:54:06 +0200 Subject: refactor(nixery): Extract layering logic into separate package This will be required for making a standalone, Nixery-style image builder function usable from Nix. Change-Id: I5e36348bd4c32d249d56f6628cd046916691319f Reviewed-on: https://cl.tvl.fyi/c/depot/+/5601 Tested-by: BuildkiteCI Reviewed-by: sterni --- tools/nixery/builder/archive.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools/nixery/builder/archive.go') diff --git a/tools/nixery/builder/archive.go b/tools/nixery/builder/archive.go index 3bc02ab4d5b8..8763e4cb8566 100644 --- a/tools/nixery/builder/archive.go +++ b/tools/nixery/builder/archive.go @@ -16,6 +16,8 @@ import ( "io" "os" "path/filepath" + + "github.com/google/nixery/layers" ) // Create a new compressed tarball from each of the paths in the list @@ -23,7 +25,7 @@ import ( // // The uncompressed tarball is hashed because image manifests must // contain both the hashes of compressed and uncompressed layers. -func packStorePaths(l *layer, w io.Writer) (string, error) { +func packStorePaths(l *layers.Layer, w io.Writer) (string, error) { shasum := sha256.New() gz := gzip.NewWriter(w) multi := io.MultiWriter(shasum, gz) -- cgit 1.4.1