Minor improvements to output and comments
parent
393d1af3c6
commit
c2bf394378
|
|
@ -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...")
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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")) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue