Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added defaultDiskSize setup to hyperkit driver #3531

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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