From 65e668a6b8051ee40f550902d966ac5a51c1421e Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Wed, 7 Dec 2016 19:59:03 -0800 Subject: [PATCH] snapshot: ensure tests compile Signed-off-by: Stephen J Day --- snapshot/manager.go | 4 ++++ snapshot/manager_test.go | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/snapshot/manager.go b/snapshot/manager.go index fcc763a5a..ce4c40113 100644 --- a/snapshot/manager.go +++ b/snapshot/manager.go @@ -139,6 +139,9 @@ func NewManager(root string) (*Manager, error) { // working directory for any associated activity, such as running a container // or importing a layer. // +// The implementation may choose to write data directly to dst, opting to +// return no mounts instead. +// // Once the writes have completed, Manager.Commit or // Manager.Rollback should be called on dst. func (lm *Manager) Prepare(dst, parent string) ([]containerd.Mount, error) { @@ -171,6 +174,7 @@ func (lm *Manager) Prepare(dst, parent string) ([]containerd.Mount, error) { return nil, err } + // TODO(stevvooe): Write this metadata to disk to make it useful. lm.active[dst] = activeLayer{ parent: parent, upperdir: upperdir, diff --git a/snapshot/manager_test.go b/snapshot/manager_test.go index 3f73bbc66..5192f892d 100644 --- a/snapshot/manager_test.go +++ b/snapshot/manager_test.go @@ -6,6 +6,8 @@ import ( "path/filepath" "strings" "testing" + + "github.com/docker/containerd" ) // TestSnapshotManagerBasic implements something similar to the conceptual @@ -44,10 +46,10 @@ func TestSnapshotManagerBasic(t *testing.T) { t.Fatalf("expected mount target to be prefixed with tmpDir: %q does not startwith %q", mount.Target, preparing) } - t.Log(MountCommand(mount)) + t.Log(containerd.MountCommand(mount)) } - if err := MountAll(mounts...); err != nil { + if err := containerd.MountAll(mounts...); err != nil { t.Fatal(err) } @@ -78,7 +80,7 @@ func TestSnapshotManagerBasic(t *testing.T) { if err != nil { t.Fatal(err) } - if err := MountAll(mounts...); err != nil { + if err := containerd.MountAll(mounts...); err != nil { t.Fatal(err) } @@ -87,7 +89,7 @@ func TestSnapshotManagerBasic(t *testing.T) { t.Fatalf("expected mount target to be prefixed with tmpDir: %q does not startwith %q", mount.Target, next) } - t.Log(MountCommand(mount)) + t.Log(containerd.MountCommand(mount)) } if err := ioutil.WriteFile(filepath.Join(next, "bar"), []byte("bar\n"), 0777); err != nil {