func countReadyReplicas(kube webservice.KubeClient, ns, rcname string) (uint, error) { pods, err := kube.GetPodsForController(ns, rcname) if err != nil { return 0, err } var count uint for _, p := range *pods { for _, c := range p.Status.Conditions { if c.Type == "Ready" && c.Status == "True" { count++ break } } } return count, nil }