Skip to content

Commit

Permalink
Merge pull request #3531 from Zyqsempai/add-default-disk-size-to-hype…
Browse files Browse the repository at this point in the history
…rkit-driver

Added defaultDiskSize setup to hyperkit driver
  • Loading branch information
tstromberg authored Jan 16, 2019
2 parents d8f2e99 + 0687fea commit dde313a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/drivers/hyperkit/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
hyperkit "github.com/moby/hyperkit/go"
"github.com/pkg/errors"
pkgdrivers "k8s.io/minikube/pkg/drivers"
"k8s.io/minikube/pkg/minikube/constants"
commonutil "k8s.io/minikube/pkg/util"
)

Expand Down Expand Up @@ -70,6 +71,7 @@ func NewDriver(hostName, storePath string) *Driver {
SSHUser: "docker",
},
CommonDriver: &pkgdrivers.CommonDriver{},
DiskSize: commonutil.CalculateDiskSizeInMB(constants.DefaultDiskSize),
}
}

Expand Down
13 changes: 13 additions & 0 deletions pkg/drivers/hyperkit/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit dde313a

Please sign in to comment.