Skip to content

Commit fa98694

Browse files
committed
Merge pull request docker-archive-public#3120 from daehyeok/Driver_env
DRIVER environment variable
2 parents 698958f + aa461f0 commit fa98694

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

commands/create.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ var (
4040
Usage: fmt.Sprintf(
4141
"Driver to create machine with.",
4242
),
43-
Value: "none",
43+
Value: "none",
44+
EnvVar: "MACHINE_DRIVER",
4445
},
4546
cli.StringFlag{
4647
Name: "engine-install-url",
@@ -290,8 +291,12 @@ func cmdCreateOuter(c CommandLine, api libmachine.API) error {
290291
// We didn't recognize the driver name.
291292
driverName := flagHackLookup("--driver")
292293
if driverName == "" {
293-
c.ShowHelp()
294-
return nil // ?
294+
//TODO: Check Environment have to include flagHackLookup function.
295+
driverName = os.Getenv("MACHINE_DRIVER")
296+
if driverName == "" {
297+
c.ShowHelp()
298+
return nil // ?
299+
}
295300
}
296301

297302
// TODO: Fix hacky JSON solution

0 commit comments

Comments
 (0)