From 0f99f313a054fbe96f5977295a3530541dec2bc1 Mon Sep 17 00:00:00 2001
From: stefanprodan <stefan.prodan@gmail.com>
Date: Wed, 29 Apr 2020 09:10:27 +0300
Subject: [PATCH] check: exit 1 on control plane failed checks

---
 cmd/tk/check.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmd/tk/check.go b/cmd/tk/check.go
index 35b17485..a5826ce2 100644
--- a/cmd/tk/check.go
+++ b/cmd/tk/check.go
@@ -202,14 +202,16 @@ func componentsCheck() bool {
 	ctx, cancel := context.WithTimeout(context.Background(), timeout)
 	defer cancel()
 
+	ok := true
 	for _, deployment := range components {
 		command := fmt.Sprintf("kubectl -n %s rollout status deployment %s --timeout=%s",
 			namespace, deployment, timeout.String())
 		if output, err := utils.execCommand(ctx, ModeCapture, command); err != nil {
 			logFailure("%s: %s", deployment, strings.TrimSuffix(output, "\n"))
+			ok = false
 		} else {
 			logSuccess("%s is healthy", deployment)
 		}
 	}
-	return true
+	return ok
 }
-- 
GitLab