Minor improvements to output and comments

pull/3533/head
Thomas Stromberg 2019-01-16 12:14:56 -08:00
parent 393d1af3c6
commit c2bf394378
3 changed files with 7 additions and 4 deletions

View File

@ -340,8 +340,8 @@ func runStart(cmd *cobra.Command, args []string) {
if !exists || config.VMDriver == constants.DriverNone {
fmt.Println("Starting cluster components...")
if err := k8sBootstrapper.StartCluster(kubernetesConfig); err != nil {
glog.Errorln("Error starting cluster: ", err)
cmdutil.MaybeReportErrorAndExit(fmt.Errorf("%s\nYou may be able to failure logs using: 'minikube logs'\n"))
glog.Errorf("Error starting cluster: %v", err)
cmdutil.MaybeReportErrorAndExit(err)
}
} else {
fmt.Println("Machine exists, restarting cluster components...")

View File

@ -130,6 +130,7 @@ func MaybeReportErrorAndExit(errToReport error) {
MaybeReportErrorAndExitWithCode(errToReport, 1)
}
// MaybeReportErrorAndExitWithCode prompts the user if they would like to report a stack trace, and exits.
func MaybeReportErrorAndExitWithCode(errToReport error, returnCode int) {
var err error
if viper.GetBool(config.WantReportError) {
@ -151,8 +152,10 @@ To disable this prompt, run: 'minikube config set WantReportErrorPrompt false'
fmt.Println("Bummer, perhaps next time!")
}
}
// This happens when the error was created without errors.Wrap(), and thus has no trace data.
if err != nil {
glog.Errorf(err.Error())
glog.Infof("report error failed: %v", err)
}
fmt.Printf("\n\nminikube failed :( exiting with error code %d\n", returnCode)
os.Exit(returnCode)

View File

@ -170,7 +170,7 @@ func (k *KubeadmBootstrapper) StartCluster(k8s config.KubernetesConfig) error {
out, err := k.c.CombinedOutput(b.String())
if err != nil {
return errors.Wrapf(err, "kubeadm init failed: %s\n%s\n", b.String(), out)
return errors.Wrapf(err, "kubeadm init: %s\n%s\n", b.String(), out)
}
if version.LT(semver.MustParse("1.10.0-alpha.0")) {