Merge pull request #1126 from r2d4/cleanup

Slim down driverGetter type
pull/1122/head
Matt Rickard 2017-02-13 12:45:26 -08:00 committed by GitHub
commit 7c607c7086
4 changed files with 7 additions and 7 deletions

View File

@ -43,7 +43,7 @@ import (
"github.com/pkg/errors"
)
type driverGetter func(string, []byte) (drivers.Driver, error)
type driverGetter func([]byte) (drivers.Driver, error)
type ClientType int
type clientFactory interface {
@ -94,7 +94,7 @@ func getDriver(driverName string, rawDriver []byte) (drivers.Driver, error) {
if !ok {
return nil, fmt.Errorf("Unknown driver %s for platform.", driverName)
}
driver, err := driverGetter(driverName, rawDriver)
driver, err := driverGetter(rawDriver)
if err != nil {
return nil, errors.Wrapf(err, "Error getting driver for %s", driverName)
}
@ -102,7 +102,7 @@ func getDriver(driverName string, rawDriver []byte) (drivers.Driver, error) {
return driver, nil
}
func getVirtualboxDriver(_ string, rawDriver []byte) (drivers.Driver, error) {
func getVirtualboxDriver(rawDriver []byte) (drivers.Driver, error) {
var driver drivers.Driver
driver = virtualbox.NewDriver("", "")
err := json.Unmarshal(rawDriver, driver)

View File

@ -33,7 +33,7 @@ var driverMap = map[string]driverGetter{
"virtualbox": getVirtualboxDriver,
}
func getVMWareFusionDriver(driverName string, rawDriver []byte) (drivers.Driver, error) {
func getVMWareFusionDriver(rawDriver []byte) (drivers.Driver, error) {
var driver drivers.Driver
driver = &vmwarefusion.Driver{}
if err := json.Unmarshal(rawDriver, &driver); err != nil {
@ -43,7 +43,7 @@ func getVMWareFusionDriver(driverName string, rawDriver []byte) (drivers.Driver,
}
// Xhyve driver not implemented yet for non-RPC access
func getXhyveDriver(driverName string, rawDriver []byte) (drivers.Driver, error) {
func getXhyveDriver(rawDriver []byte) (drivers.Driver, error) {
return nil, errors.New(`
The Xhyve driver is not included in minikube yet. Please follow the directions at
https://github.com/kubernetes/minikube/blob/master/DRIVERS.md#xhyve-driver

View File

@ -32,7 +32,7 @@ var driverMap = map[string]driverGetter{
"virtualbox": getVirtualboxDriver,
}
func getKVMDriver(driverName string, rawDriver []byte) (drivers.Driver, error) {
func getKVMDriver(rawDriver []byte) (drivers.Driver, error) {
var driver drivers.Driver
driver = &kvm.Driver{}
if err := json.Unmarshal(rawDriver, &driver); err != nil {

View File

@ -32,7 +32,7 @@ var driverMap = map[string]driverGetter{
"virtualbox": getVirtualboxDriver,
}
func getHyperVDriver(driverName string, rawDriver []byte) (drivers.Driver, error) {
func getHyperVDriver(rawDriver []byte) (drivers.Driver, error) {
var driver drivers.Driver
driver = &hyperv.Driver{}
if err := json.Unmarshal(rawDriver, &driver); err != nil {