Merge pull request #3531 from Zyqsempai/add-default-disk-size-to-hyperkit-driver
Added defaultDiskSize setup to hyperkit driverpull/3534/head
commit
dde313a878
|
@ -37,6 +37,7 @@ import (
|
||||||
hyperkit "github.com/moby/hyperkit/go"
|
hyperkit "github.com/moby/hyperkit/go"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
pkgdrivers "k8s.io/minikube/pkg/drivers"
|
pkgdrivers "k8s.io/minikube/pkg/drivers"
|
||||||
|
"k8s.io/minikube/pkg/minikube/constants"
|
||||||
commonutil "k8s.io/minikube/pkg/util"
|
commonutil "k8s.io/minikube/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -70,6 +71,7 @@ func NewDriver(hostName, storePath string) *Driver {
|
||||||
SSHUser: "docker",
|
SSHUser: "docker",
|
||||||
},
|
},
|
||||||
CommonDriver: &pkgdrivers.CommonDriver{},
|
CommonDriver: &pkgdrivers.CommonDriver{},
|
||||||
|
DiskSize: commonutil.CalculateDiskSizeInMB(constants.DefaultDiskSize),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,10 @@ package hyperkit
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"k8s.io/minikube/pkg/minikube/constants"
|
||||||
|
|
||||||
|
commonutil "k8s.io/minikube/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_portExtraction(t *testing.T) {
|
func Test_portExtraction(t *testing.T) {
|
||||||
|
@ -62,6 +66,15 @@ func Test_portExtraction(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_defaultDiskSize(t *testing.T) {
|
||||||
|
expectedDefaultDiscSize := commonutil.CalculateDiskSizeInMB(constants.DefaultDiskSize)
|
||||||
|
driver := NewDriver("", "")
|
||||||
|
got := driver.DiskSize
|
||||||
|
if got != expectedDefaultDiscSize {
|
||||||
|
t.Errorf("Unexpected default disk size got: %v, want: %v", got, expectedDefaultDiscSize)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func testEq(a, b []int) bool {
|
func testEq(a, b []int) bool {
|
||||||
|
|
||||||
if a == nil && b == nil {
|
if a == nil && b == nil {
|
||||||
|
|
Loading…
Reference in New Issue