rootfs: Add context to Prepare

Signed-off-by: Samuel Karp <skarp@amazon.com>
This commit is contained in:
Samuel Karp 2017-02-26 23:53:29 -08:00
parent 4382d553ea
commit b471a84885

View file

@ -84,7 +84,7 @@ func ApplyLayer(snapshots snapshot.Snapshotter, mounter Mounter, rd io.Reader, p
// //
// If successful, the chainID for the top-level layer is returned. That // If successful, the chainID for the top-level layer is returned. That
// identifier can be used to check out a snapshot. // identifier can be used to check out a snapshot.
func Prepare(snapshots snapshot.Snapshotter, mounter Mounter, layers []ocispec.Descriptor, func Prepare(ctx context.Context, snapshots snapshot.Snapshotter, mounter Mounter, layers []ocispec.Descriptor,
// TODO(stevvooe): The following functions are candidate for internal // TODO(stevvooe): The following functions are candidate for internal
// object functions. We can use these to formulate the beginnings of a // object functions. We can use these to formulate the beginnings of a
// rootfs Controller. // rootfs Controller.
@ -97,7 +97,6 @@ func Prepare(snapshots snapshot.Snapshotter, mounter Mounter, layers []ocispec.D
parent digest.Digest parent digest.Digest
chain []digest.Digest chain []digest.Digest
) )
ctx := context.TODO()
for _, layer := range layers { for _, layer := range layers {
// TODO: layer.Digest should not be string // TODO: layer.Digest should not be string