Skip to content

Commit

Permalink
fix unable to set memory in config
Browse files Browse the repository at this point in the history
Signed-off-by: Tharun <rajendrantharun@live.com>
  • Loading branch information
tharun208 committed Nov 26, 2020
1 parent 322e138 commit 5b8670c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ var settings = []Setting{
},
{
name: "memory",
set: SetInt,
validations: []setFn{IsPositive},
set: SetString,
validations: []setFn{IsValidDiskSize},
callbacks: []setFn{RequiresRestartMsg},
},
{
Expand Down
4 changes: 4 additions & 0 deletions cmd/minikube/cmd/config/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5b8670c

Please sign in to comment.