Merge pull request #40 from shykes/creack-0.6.5-dm-plugin
Rename gograph and move drivers to sub pkg
This commit is contained in:
commit
427649eee1
|
@ -1,4 +1,4 @@
|
|||
package gograph
|
||||
package graphdb
|
||||
|
||||
import (
|
||||
"database/sql"
|
|
@ -1,4 +1,4 @@
|
|||
package gograph
|
||||
package graphdb
|
||||
|
||||
import (
|
||||
_ "code.google.com/p/gosqlite/sqlite3"
|
|
@ -1,4 +1,4 @@
|
|||
package gograph
|
||||
package graphdb
|
||||
|
||||
import "sort"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package gograph
|
||||
package graphdb
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -1,4 +1,4 @@
|
|||
package gograph
|
||||
package graphdb
|
||||
|
||||
import (
|
||||
"path"
|
18
runtime.go
18
runtime.go
|
@ -6,10 +6,10 @@ import (
|
|||
"database/sql"
|
||||
"fmt"
|
||||
"github.com/dotcloud/docker/archive"
|
||||
_ "github.com/dotcloud/docker/aufs"
|
||||
_ "github.com/dotcloud/docker/devmapper"
|
||||
"github.com/dotcloud/docker/gograph"
|
||||
"github.com/dotcloud/docker/graphdb"
|
||||
"github.com/dotcloud/docker/graphdriver"
|
||||
_ "github.com/dotcloud/docker/graphdriver/aufs"
|
||||
_ "github.com/dotcloud/docker/graphdriver/devmapper"
|
||||
_ "github.com/dotcloud/docker/graphdriver/dummy"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
"io"
|
||||
|
@ -43,7 +43,7 @@ type Runtime struct {
|
|||
volumes *Graph
|
||||
srv *Server
|
||||
config *DaemonConfig
|
||||
containerGraph *gograph.Database
|
||||
containerGraph *graphdb.Database
|
||||
driver graphdriver.Driver
|
||||
}
|
||||
|
||||
|
@ -581,7 +581,7 @@ func (runtime *Runtime) Children(name string) (map[string]*Container, error) {
|
|||
}
|
||||
children := make(map[string]*Container)
|
||||
|
||||
err = runtime.containerGraph.Walk(name, func(p string, e *gograph.Entity) error {
|
||||
err = runtime.containerGraph.Walk(name, func(p string, e *graphdb.Entity) error {
|
||||
c := runtime.Get(e.ID())
|
||||
if c == nil {
|
||||
return fmt.Errorf("Could not get container for name %s and id %s", e.ID(), p)
|
||||
|
@ -659,20 +659,20 @@ func NewRuntimeFromDirectory(config *DaemonConfig) (*Runtime, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
gographPath := path.Join(config.Root, "linkgraph.db")
|
||||
graphdbPath := path.Join(config.Root, "linkgraph.db")
|
||||
initDatabase := false
|
||||
if _, err := os.Stat(gographPath); err != nil {
|
||||
if _, err := os.Stat(graphdbPath); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
initDatabase = true
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
conn, err := sql.Open("sqlite3", gographPath)
|
||||
conn, err := sql.Open("sqlite3", graphdbPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
graph, err := gograph.NewDatabase(conn, initDatabase)
|
||||
graph, err := graphdb.NewDatabase(conn, initDatabase)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"github.com/dotcloud/docker/archive"
|
||||
"github.com/dotcloud/docker/auth"
|
||||
"github.com/dotcloud/docker/engine"
|
||||
"github.com/dotcloud/docker/gograph"
|
||||
"github.com/dotcloud/docker/graphdb"
|
||||
"github.com/dotcloud/docker/registry"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
"io"
|
||||
|
@ -502,7 +502,7 @@ func createAPIContainer(container *Container, size bool, runtime *Runtime) APICo
|
|||
ID: container.ID,
|
||||
}
|
||||
names := []string{}
|
||||
runtime.containerGraph.Walk("/", func(p string, e *gograph.Entity) error {
|
||||
runtime.containerGraph.Walk("/", func(p string, e *graphdb.Entity) error {
|
||||
if e.ID() == container.ID {
|
||||
names = append(names, p)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue