From 2119d119b008003f1080b3074c7b6155b56eec48 Mon Sep 17 00:00:00 2001 From: Abubakr-Sadik Nii Nai Davis Date: Tue, 4 Jul 2017 15:38:34 +0000 Subject: [PATCH] Restore warning messages and dont quit on verification error. --- cmd/common.go | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/cmd/common.go b/cmd/common.go index 90cbed0..b406eda 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -55,14 +55,11 @@ func runChecks(t check.NodeType) { var summary check.Summary var file string - fails := verifyNodeType(t) - if len(fails) > 0 { - fmt.Fprintf(os.Stderr, "%s could not start: please resolve these issues\n", os.Args[0]) - for _, w := range fails { - colorPrint(check.FAIL, w) + warns := verifyNodeType(t) + if len(warns) > 0 { + for _, w := range warns { + colorPrint(check.WARN, w) } - - os.Exit(1) } switch t { @@ -117,7 +114,7 @@ func runChecks(t check.NodeType) { fmt.Println(string(out)) } else { - prettyPrint(fails, controls, summary) + prettyPrint(warns, controls, summary) } } @@ -246,10 +243,7 @@ func verifyBin(binPath []string) []string { // Run ps command cmd := exec.Command("ps", "-C", binList, "-o", "cmd", "--no-headers") - out, err := cmd.Output() - if err != nil { - w = append(w, fmt.Sprintf("%v could not get process information\n", binPath)) - } + out, _ := cmd.Output() // Actual verification for _, b := range binPath { @@ -277,10 +271,7 @@ func verifyKubeVersion(binPath []string) []string { // Check version cmd := exec.Command(b, "--version") - out, err := cmd.Output() - if err != nil { - w = append(w, fmt.Sprintf("failed executing %s --version: %v\n", b, err)) - } + out, _ := cmd.Output() matched := strings.Contains(string(out), kubeVersion) if !matched {