From a9128a2cb43e622a2337b7737977dd28480216d0 Mon Sep 17 00:00:00 2001
From: stefanprodan <stefan.prodan@gmail.com>
Date: Mon, 27 Apr 2020 10:19:29 +0300
Subject: [PATCH] Log source sync failure message

---
 cmd/tk/create_source.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/tk/create_source.go b/cmd/tk/create_source.go
index 5b7b85fe..1f4ae8dd 100644
--- a/cmd/tk/create_source.go
+++ b/cmd/tk/create_source.go
@@ -150,7 +150,7 @@ func createSourceCmdRun(cmd *cobra.Command, args []string) error {
 	logAction("waiting for source sync")
 	if err := wait.PollImmediate(2*time.Second, timeout,
 		isGitRepositoryReady(ctx, kubeClient, name, namespace)); err != nil {
-		return fmt.Errorf("source sync failed: %w", err)
+		return err
 	}
 
 	logSuccess("source %s is ready", name)
@@ -240,7 +240,7 @@ func isGitRepositoryReady(ctx context.Context, kubeClient client.Client, name, n
 				if condition.Status == corev1.ConditionTrue {
 					return true, nil
 				} else if condition.Status == corev1.ConditionFalse {
-					return false, nil
+					return false, fmt.Errorf(condition.Message)
 				}
 			}
 		}
-- 
GitLab