Skip to content

Commit

Permalink
Merge pull request #9789 from tharun208/fix/config_memory
Browse files Browse the repository at this point in the history
fix unable to set memory in config
  • Loading branch information
medyagh authored Dec 8, 2020
2 parents 4a0382f + 5b8670c commit 3e670f2
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 3e670f2

Please sign in to comment.