Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1 from kubernetes/master
Browse files Browse the repository at this point in the history
sync-2020.10.02
  • Loading branch information
prezha committed Oct 2, 2020
2 parents fb11bbe + 5a519b2 commit dbd9135
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/drivers/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/docker/machine/libmachine/ssh"
"github.com/golang/glog"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/util"
)

// This file is for common code shared among internal machine drivers
Expand Down Expand Up @@ -74,7 +75,7 @@ func createRawDiskImage(sshKeyPath, diskPath string, diskSizeMb int) error {
return errors.Wrapf(err, "closing file %s", diskPath)
}

if err := os.Truncate(diskPath, int64(diskSizeMb*1000000)); err != nil {
if err := os.Truncate(diskPath, util.ConvertMBToBytes(diskSizeMb)); err != nil {
return errors.Wrap(err, "truncate")
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Test_createDiskImage(t *testing.T) {
diskPath := filepath.Join(tmpdir, "disk")

sizeInMb := 100
sizeInBytes := int64(sizeInMb) * 1000000
sizeInBytes := int64(104857600)
if err := createRawDiskImage(sshPath, diskPath, sizeInMb); err != nil {
t.Errorf("createDiskImage() error = %v", err)
}
Expand Down

0 comments on commit dbd9135

Please sign in to comment.