Merge pull request #25284 from bprashanth/service_unready

Automatic merge from submit-queue

Add a service annotation that allows endpoints for unready pods

See https://github.com/kubernetes/kubernetes/issues/25283 for context 
@smarterclayton @thockin yes?

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/25284)
<!-- Reviewable:end -->
This commit is contained in:
k8s-merge-robot
2016-05-12 12:05:27 -07:00
4 changed files with 83 additions and 2 deletions

View File

@@ -254,6 +254,9 @@ func (f *fakePetClient) setHealthy(index int) error {
}
f.pets[index].pod.Status.Phase = api.PodRunning
f.pets[index].pod.Annotations[PetSetInitAnnotation] = "true"
f.pets[index].pod.Status.Conditions = []api.PodCondition{
{Type: api.PodReady, Status: api.ConditionTrue},
}
return nil
}

View File

@@ -299,7 +299,7 @@ func (d *defaultPetHealthChecker) isHealthy(pod *api.Pod) bool {
if err != nil {
return false
}
return b
return b && api.IsPodReady(pod)
}
// isDying returns true if the pod has a non-nil deletion timestamp. Since the