From cd8bae1df53e29a7089590c7c8f8beb2acb453cc Mon Sep 17 00:00:00 2001
From: Maxim Ivanov <ivanov.maxim@gmail.com>
Date: Wed, 27 Sep 2017 17:52:06 +0100
Subject: [PATCH] More helpful wait messages in tiller logs

---
 pkg/kube/wait.go | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/pkg/kube/wait.go b/pkg/kube/wait.go
index 30173167e..99a9bb15e 100644
--- a/pkg/kube/wait.go
+++ b/pkg/kube/wait.go
@@ -122,22 +122,22 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
 				services = append(services, *svc)
 			}
 		}
-		isReady := podsReady(pods) && servicesReady(services) && volumesReady(pvc) && deploymentsReady(deployments)
-		c.Log("resources ready: %v", isReady)
+		isReady := c.podsReady(pods) && c.servicesReady(services) && c.volumesReady(pvc) && c.deploymentsReady(deployments)
 		return isReady, nil
 	})
 }
 
-func podsReady(pods []v1.Pod) bool {
+func (c *Client) podsReady(pods []v1.Pod) bool {
 	for _, pod := range pods {
 		if !podutil.IsPodReady(&pod) {
+			c.Log("Pod is not ready: %s/%s", pod.GetNamespace(), pod.GetName())
 			return false
 		}
 	}
 	return true
 }
 
-func servicesReady(svc []v1.Service) bool {
+func (c *Client) servicesReady(svc []v1.Service) bool {
 	for _, s := range svc {
 		// ExternalName Services are external to cluster so helm shouldn't be checking to see if they're 'ready' (i.e. have an IP Set)
 		if s.Spec.Type == v1.ServiceTypeExternalName {
@@ -146,28 +146,32 @@ func servicesReady(svc []v1.Service) bool {
 
 		// Make sure the service is not explicitly set to "None" before checking the IP
 		if s.Spec.ClusterIP != v1.ClusterIPNone && !helper.IsServiceIPSet(&s) {
+			c.Log("Service is not ready: %s/%s", s.GetNamespace(), s.GetName())
 			return false
 		}
 		// This checks if the service has a LoadBalancer and that balancer has an Ingress defined
 		if s.Spec.Type == v1.ServiceTypeLoadBalancer && s.Status.LoadBalancer.Ingress == nil {
+			c.Log("Service is not ready: %s/%s", s.GetNamespace(), s.GetName())
 			return false
 		}
 	}
 	return true
 }
 
-func volumesReady(vols []v1.PersistentVolumeClaim) bool {
+func (c *Client) volumesReady(vols []v1.PersistentVolumeClaim) bool {
 	for _, v := range vols {
 		if v.Status.Phase != v1.ClaimBound {
+			c.Log("PersistentVolumeClaim is not ready: %s/%s", v.GetNamespace(), v.GetName())
 			return false
 		}
 	}
 	return true
 }
 
-func deploymentsReady(deployments []deployment) bool {
+func (c *Client) deploymentsReady(deployments []deployment) bool {
 	for _, v := range deployments {
 		if !(v.replicaSets.Status.ReadyReplicas >= *v.deployment.Spec.Replicas-deploymentutil.MaxUnavailable(*v.deployment)) {
+			c.Log("Deployment is not ready: %s/%s", v.deployment.GetNamespace(), v.deployment.GetName())
 			return false
 		}
 	}
-- 
GitLab