Fix aufs error at startup
Add String methods to other drivers
This commit is contained in:
parent
8c21d2acd3
commit
51c93c0f33
|
@ -58,7 +58,7 @@ func Init(root string) (graphdriver.Driver, error) {
|
||||||
// if it already exists
|
// if it already exists
|
||||||
// If not populate the dir structure
|
// If not populate the dir structure
|
||||||
aufsPath := path.Join(root, "aufs")
|
aufsPath := path.Join(root, "aufs")
|
||||||
if err := os.Mkdir(aufsPath, 0755); err != nil {
|
if err := os.MkdirAll(aufsPath, 0755); err != nil {
|
||||||
if os.IsExist(err) {
|
if os.IsExist(err) {
|
||||||
return &AufsDriver{root}, nil
|
return &AufsDriver{root}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,10 @@ func Init(home string) (graphdriver.Driver, error) {
|
||||||
return d, nil
|
return d, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *Driver) String() string {
|
||||||
|
return "devicemapper"
|
||||||
|
}
|
||||||
|
|
||||||
func (d *Driver) Cleanup() error {
|
func (d *Driver) Cleanup() error {
|
||||||
return d.DeviceSet.Shutdown()
|
return d.DeviceSet.Shutdown()
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ package graphdriver
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/dotcloud/docker/archive"
|
"github.com/dotcloud/docker/archive"
|
||||||
|
"github.com/dotcloud/docker/utils"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
type InitFunc func(root string) (Driver, error)
|
type InitFunc func(root string) (Driver, error)
|
||||||
|
|
||||||
type Driver interface {
|
type Driver interface {
|
||||||
|
@ -64,6 +64,7 @@ func New(root string) (Driver, error) {
|
||||||
for _, name := range priority {
|
for _, name := range priority {
|
||||||
driver, lastError = getDriver(name, root)
|
driver, lastError = getDriver(name, root)
|
||||||
if lastError != nil {
|
if lastError != nil {
|
||||||
|
utils.Debugf("Error loading driver %s: %s", name, lastError)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return driver, nil
|
return driver, nil
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package dummy
|
package dummy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/dotcloud/docker/archive"
|
"github.com/dotcloud/docker/archive"
|
||||||
"github.com/dotcloud/docker/graphdriver"
|
"github.com/dotcloud/docker/graphdriver"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -23,6 +23,10 @@ type Driver struct {
|
||||||
home string
|
home string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *Driver) String() string {
|
||||||
|
return "dummy"
|
||||||
|
}
|
||||||
|
|
||||||
func (d *Driver) Cleanup() error {
|
func (d *Driver) Cleanup() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -52,7 +56,6 @@ func (d *Driver) dir(id string) string {
|
||||||
return path.Join(d.home, "dir", path.Base(id))
|
return path.Join(d.home, "dir", path.Base(id))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (d *Driver) Remove(id string) error {
|
func (d *Driver) Remove(id string) error {
|
||||||
if _, err := os.Stat(d.dir(id)); err != nil {
|
if _, err := os.Stat(d.dir(id)); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -81,4 +84,3 @@ func (d *Driver) DiffSize(id string) (int64, error) {
|
||||||
func (d *Driver) Changes(id string) ([]archive.Change, error) {
|
func (d *Driver) Changes(id string) ([]archive.Change, error) {
|
||||||
return nil, fmt.Errorf("Not implemented")
|
return nil, fmt.Errorf("Not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue