Skip to content

Commit

Permalink
Add more debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tstromberg committed Oct 25, 2019
1 parent c153919 commit c50a849
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/minikube/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func Choose(options []registry.DriverState) (registry.DriverState, []registry.Dr
continue
}
if ds.Priority > pick.Priority {
glog.V(1).Infof("%q has a higher priority (%d) than %q (%d)", ds.Name, ds.Priority, pick.Name, pick.Priority)
pick = ds
}
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/minikube/registry/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package registry

import (
"os"

"github.com/golang/glog"
)

Expand Down Expand Up @@ -54,12 +56,16 @@ func Driver(name string) DriverDef {
// Installed returns a list of installed drivers in the global registry
func Installed() []DriverState {
sts := []DriverState{}
glog.Infof("Querying for installed drivers using PATH=%s", os.Getenv("PATH"))

for _, d := range globalRegistry.List() {
if d.Status == nil {
glog.Errorf("%q does not implement Status", d.Name)
continue
}
s := d.Status()
glog.Infof("%s priority: %d, state: %+v", d.Name, d.Priority, s)

if !s.Installed {
glog.Infof("%q not installed: %v", d.Name, s.Error)
continue
Expand Down
9 changes: 8 additions & 1 deletion test/integration/a_serial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ func TestDownloadOnly(t *testing.T) {
// Explicitly does not pass StartArgs() to test driver default
// --force to avoid uid check
args := []string{"start", "--download-only", "-p", profile, "--force", "--alsologtostderr", fmt.Sprintf("--kubernetes-version=%s", v)}
rrr, err = Run(t, exec.CommandContext(ctx, Target(), args...))

// Preserve the initial run-result for debugging
if rrr == nil {
rrr, err = Run(t, exec.CommandContext(ctx, Target(), args...))
} else {
_, err = Run(t, exec.CommandContext(ctx, Target(), args...))
}

if err != nil {
t.Errorf("%s failed: %v", args, err)
}
Expand Down

0 comments on commit c50a849

Please sign in to comment.