Move volume ref counting store to a package.

- Add unit tests to make sure the functionality is correct.
- Add FilterByDriver to allow filtering volumes by driver, for future
  `volume ls` filtering and whatnot.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera
2015-09-18 19:58:05 -04:00
parent 587558f617
commit 72bb56618b
11 changed files with 456 additions and 182 deletions

View File

@@ -15,6 +15,7 @@ import (
"github.com/docker/docker/volume"
volumedrivers "github.com/docker/docker/volume/drivers"
"github.com/docker/docker/volume/local"
"github.com/docker/docker/volume/store"
)
//
@@ -505,7 +506,7 @@ func initDaemonForVolumesTest(tmp string) (*Daemon, error) {
daemon := &Daemon{
repository: tmp,
root: tmp,
volumes: newVolumeStore([]volume.Volume{}),
volumes: store.New(),
}
volumesDriver, err := local.New(tmp)