github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/volume/service/default_driver.go (about)

     1  // +build linux windows
     2  
     3  package service // import "github.com/demonoid81/moby/volume/service"
     4  import (
     5  	"github.com/demonoid81/moby/pkg/idtools"
     6  	"github.com/demonoid81/moby/volume"
     7  	"github.com/demonoid81/moby/volume/drivers"
     8  	"github.com/demonoid81/moby/volume/local"
     9  	"github.com/pkg/errors"
    10  )
    11  
    12  func setupDefaultDriver(store *drivers.Store, root string, rootIDs idtools.Identity) error {
    13  	d, err := local.New(root, rootIDs)
    14  	if err != nil {
    15  		return errors.Wrap(err, "error setting up default driver")
    16  	}
    17  	if !store.Register(d, volume.DefaultDriverName) {
    18  		return errors.New("local volume driver could not be registered")
    19  	}
    20  	return nil
    21  }