Commit cd8bae1d authored by Maxim Ivanov's avatar Maxim Ivanov

More helpful wait messages in tiller logs

parent 2b32fa44
...@@ -122,22 +122,22 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error { ...@@ -122,22 +122,22 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
services = append(services, *svc) services = append(services, *svc)
} }
} }
isReady := podsReady(pods) && servicesReady(services) && volumesReady(pvc) && deploymentsReady(deployments) isReady := c.podsReady(pods) && c.servicesReady(services) && c.volumesReady(pvc) && c.deploymentsReady(deployments)
c.Log("resources ready: %v", isReady)
return isReady, nil return isReady, nil
}) })
} }
func podsReady(pods []v1.Pod) bool { func (c *Client) podsReady(pods []v1.Pod) bool {
for _, pod := range pods { for _, pod := range pods {
if !podutil.IsPodReady(&pod) { if !podutil.IsPodReady(&pod) {
c.Log("Pod is not ready: %s/%s", pod.GetNamespace(), pod.GetName())
return false return false
} }
} }
return true return true
} }
func servicesReady(svc []v1.Service) bool { func (c *Client) servicesReady(svc []v1.Service) bool {
for _, s := range svc { 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) // 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 { if s.Spec.Type == v1.ServiceTypeExternalName {
...@@ -146,28 +146,32 @@ func servicesReady(svc []v1.Service) bool { ...@@ -146,28 +146,32 @@ func servicesReady(svc []v1.Service) bool {
// Make sure the service is not explicitly set to "None" before checking the IP // Make sure the service is not explicitly set to "None" before checking the IP
if s.Spec.ClusterIP != v1.ClusterIPNone && !helper.IsServiceIPSet(&s) { if s.Spec.ClusterIP != v1.ClusterIPNone && !helper.IsServiceIPSet(&s) {
c.Log("Service is not ready: %s/%s", s.GetNamespace(), s.GetName())
return false return false
} }
// This checks if the service has a LoadBalancer and that balancer has an Ingress defined // 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 { 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 false
} }
} }
return true return true
} }
func volumesReady(vols []v1.PersistentVolumeClaim) bool { func (c *Client) volumesReady(vols []v1.PersistentVolumeClaim) bool {
for _, v := range vols { for _, v := range vols {
if v.Status.Phase != v1.ClaimBound { if v.Status.Phase != v1.ClaimBound {
c.Log("PersistentVolumeClaim is not ready: %s/%s", v.GetNamespace(), v.GetName())
return false return false
} }
} }
return true return true
} }
func deploymentsReady(deployments []deployment) bool { func (c *Client) deploymentsReady(deployments []deployment) bool {
for _, v := range deployments { for _, v := range deployments {
if !(v.replicaSets.Status.ReadyReplicas >= *v.deployment.Spec.Replicas-deploymentutil.MaxUnavailable(*v.deployment)) { 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 return false
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment