diff --git a/cmd/minikube/cmd/config/config.go b/cmd/minikube/cmd/config/config.go index 08f4608f292d..5869c1d1752b 100644 --- a/cmd/minikube/cmd/config/config.go +++ b/cmd/minikube/cmd/config/config.go @@ -92,8 +92,8 @@ var settings = []Setting{ }, { name: "memory", - set: SetInt, - validations: []setFn{IsPositive}, + set: SetString, + validations: []setFn{IsValidDiskSize}, callbacks: []setFn{RequiresRestartMsg}, }, { diff --git a/cmd/minikube/cmd/config/set_test.go b/cmd/minikube/cmd/config/set_test.go index 5d73523fff9a..7469b3798a09 100644 --- a/cmd/minikube/cmd/config/set_test.go +++ b/cmd/minikube/cmd/config/set_test.go @@ -38,6 +38,10 @@ func TestSetNotAllowed(t *testing.T) { if err == nil || err.Error() != "run validations for \"driver\" with value of \"123456\": [driver \"123456\" is not supported]" { t.Fatalf("Set did not return error for unallowed value: %+v", err) } + err = Set("memory", "10a") + if err == nil || err.Error() != "run validations for \"memory\" with value of \"10a\": [invalid disk size: invalid size: '10a']" { + t.Fatalf("Set did not return error for unallowed value: %+v", err) + } } func TestSetOK(t *testing.T) {