Code review comments
parent
09cdf602b8
commit
750cf39f1e
|
@ -27,7 +27,7 @@ import (
|
||||||
"k8s.io/minikube/pkg/minikube/style"
|
"k8s.io/minikube/pkg/minikube/style"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Message outputs a templated fatal error message and exits with the supplied error code.
|
// Message outputs a templated message and exits without interpretation
|
||||||
func Message(r reason.Kind, format string, args ...out.V) {
|
func Message(r reason.Kind, format string, args ...out.V) {
|
||||||
if r.ID == "" {
|
if r.ID == "" {
|
||||||
glog.Errorf("supplied reason has no ID: %+v", r)
|
glog.Errorf("supplied reason has no ID: %+v", r)
|
||||||
|
@ -63,7 +63,7 @@ func Advice(r reason.Kind, msg string, advice string, a ...out.V) {
|
||||||
Message(r, msg, a...)
|
Message(r, msg, a...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error outputs an error and exits.
|
// Error takes a fatal error, matches it against known issues, and outputs the best message for it
|
||||||
func Error(r reason.Kind, msg string, err error) {
|
func Error(r reason.Kind, msg string, err error) {
|
||||||
ki := reason.MatchKnownIssue(r, err, runtime.GOOS)
|
ki := reason.MatchKnownIssue(r, err, runtime.GOOS)
|
||||||
if ki != nil {
|
if ki != nil {
|
||||||
|
|
|
@ -50,7 +50,7 @@ func knownIssues() []match {
|
||||||
return ps
|
return ps
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindMatch returns a known issue from an error on an OS
|
// MatchKnownIssue returns a known issue from an error on an OS
|
||||||
func MatchKnownIssue(r Kind, err error, goos string) *Kind {
|
func MatchKnownIssue(r Kind, err error, goos string) *Kind {
|
||||||
// The kind passed in has specified that it should not be rematched
|
// The kind passed in has specified that it should not be rematched
|
||||||
if r.NoMatch {
|
if r.NoMatch {
|
||||||
|
|
|
@ -74,8 +74,8 @@ type StatusChecker func() State
|
||||||
type State struct {
|
type State struct {
|
||||||
Installed bool
|
Installed bool
|
||||||
Healthy bool
|
Healthy bool
|
||||||
Running bool // the provider does not appear to be running
|
Running bool // it at least appears to be running
|
||||||
NeedsImprovement bool // driver is healthy but could be improved
|
NeedsImprovement bool // healthy but could be improved
|
||||||
Error error
|
Error error
|
||||||
Fix string
|
Fix string
|
||||||
Doc string
|
Doc string
|
||||||
|
|
Loading…
Reference in New Issue