This repository has been archived by the owner on Sep 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix up some issues around the new model
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
- Loading branch information
1 parent
e4e442e
commit 7dbd979
Showing
7 changed files
with
90 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package drivermaker | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/docker/machine/libmachine/drivers" | ||
"github.com/docker/machine/libmachine/drivers/none" | ||
"github.com/docker/machine/libmachine/drivers/virtualbox" | ||
) | ||
|
||
func NewDriver(driverName, hostName, artifactPath string) (drivers.Driver, error) { | ||
var ( | ||
driver drivers.Driver | ||
) | ||
|
||
switch driverName { | ||
case "virtualbox": | ||
driver = virtualbox.NewDriver(hostName, artifactPath) | ||
case "none": | ||
driver = &none.Driver{} | ||
default: | ||
return nil, fmt.Errorf("Driver %s not recognized", driverName) | ||
} | ||
|
||
return driver, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters