diff --git a/pkg/drivers/hyperkit/driver.go b/pkg/drivers/hyperkit/driver.go index 442adc0ec6e6..32b7a02c7980 100644 --- a/pkg/drivers/hyperkit/driver.go +++ b/pkg/drivers/hyperkit/driver.go @@ -36,6 +36,7 @@ import ( nfsexports "github.com/johanneswuerbach/nfsexports" hyperkit "github.com/moby/hyperkit/go" "github.com/pkg/errors" + "k8s.io/minikube/pkg/minikube/constants" pkgdrivers "k8s.io/minikube/pkg/drivers" commonutil "k8s.io/minikube/pkg/util" ) @@ -70,6 +71,7 @@ func NewDriver(hostName, storePath string) *Driver { SSHUser: "docker", }, CommonDriver: &pkgdrivers.CommonDriver{}, + DiskSize: commonutil.CalculateDiskSizeInMB(constants.DefaultDiskSize), } } diff --git a/pkg/drivers/hyperkit/driver_test.go b/pkg/drivers/hyperkit/driver_test.go index 22d4ddbd39c0..3ee661ad78ff 100644 --- a/pkg/drivers/hyperkit/driver_test.go +++ b/pkg/drivers/hyperkit/driver_test.go @@ -20,6 +20,10 @@ package hyperkit import ( "testing" + + "k8s.io/minikube/pkg/minikube/constants" + + commonutil "k8s.io/minikube/pkg/util" ) 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 { if a == nil && b == nil {