Skip to content

Commit

Permalink
Updates output string and fixes failed unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lxzhang000 committed Feb 10, 2021
1 parent 8620ab6 commit 6d8ecdf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/minikube/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func Suggest(options []registry.DriverState) (registry.DriverState, []registry.D
}

if pick.Name == "" {
ds.Rejection = "Rejected due to low priority"
ds.Rejection = fmt.Sprintf("Not selected: %s must be specified explicitly using --driver", ds.Name)
} else {
ds.Rejection = fmt.Sprintf("%s is preferred", pick.Name)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/minikube/driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func TestSuggest(t *testing.T) {
{
def: registry.DriverDef{
Name: "unhealthy",
Priority: registry.Default,
Priority: registry.Deprecated,
Status: func() registry.State { return registry.State{Installed: true, Healthy: false} },
},
choices: []string{"unhealthy"},
Expand All @@ -144,7 +144,7 @@ func TestSuggest(t *testing.T) {
Priority: registry.Default,
Status: func() registry.State { return registry.State{Installed: true, Healthy: true} },
},
choices: []string{"unhealthy", "default", "discouraged"},
choices: []string{"default", "unhealthy", "discouraged"},
pick: "default",
alts: []string{"discouraged"},
rejects: []string{"unhealthy"},
Expand All @@ -155,7 +155,7 @@ func TestSuggest(t *testing.T) {
Priority: registry.Preferred,
Status: func() registry.State { return registry.State{Installed: true, Healthy: true} },
},
choices: []string{"preferred", "unhealthy", "default", "discouraged"},
choices: []string{"preferred", "default", "unhealthy", "discouraged"},
pick: "preferred",
alts: []string{"default", "discouraged"},
rejects: []string{"unhealthy"},
Expand Down
8 changes: 4 additions & 4 deletions pkg/minikube/registry/global_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestGlobalAvailable(t *testing.T) {

bar := DriverDef{
Name: "healthy-bar",
Priority: Default,
Priority: Preferred,
Status: func() State { return State{Healthy: true} },
}
if err := Register(bar); err != nil {
Expand All @@ -82,7 +82,7 @@ func TestGlobalAvailable(t *testing.T) {

foo := DriverDef{
Name: "unhealthy-foo",
Priority: Default,
Priority: Fallback,
Status: func() State { return State{Healthy: false} },
}
if err := Register(foo); err != nil {
Expand All @@ -92,12 +92,12 @@ func TestGlobalAvailable(t *testing.T) {
expected := []DriverState{
{
Name: "healthy-bar",
Priority: Default,
Priority: Preferred,
State: State{Healthy: true},
},
{
Name: "unhealthy-foo",
Priority: Default,
Priority: Fallback,
State: State{Healthy: false},
},
}
Expand Down

0 comments on commit 6d8ecdf

Please sign in to comment.