mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Check env var for setting driver in tests
This commit is contained in:
parent
6dbeed89c0
commit
aea6001baf
1 changed files with 9 additions and 2 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"github.com/dotcloud/docker/archive"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
"os"
|
||||
"path"
|
||||
)
|
||||
|
||||
|
@ -66,9 +67,15 @@ func New(root string) (Driver, error) {
|
|||
var driver Driver
|
||||
var lastError error
|
||||
|
||||
if DefaultDriver != "" {
|
||||
return GetDriver(DefaultDriver, root)
|
||||
for _, name := range []string{
|
||||
os.Getenv("DOCKER_DRIVER"),
|
||||
DefaultDriver,
|
||||
} {
|
||||
if name != "" {
|
||||
return GetDriver(name, root)
|
||||
}
|
||||
}
|
||||
|
||||
// Check for priority drivers first
|
||||
for _, name := range priority {
|
||||
driver, lastError = GetDriver(name, root)
|
||||
|
|
Loading…
Add table
Reference in a new issue