Merge pull request #57458 from juju-solutions/bug/evicted

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Evicted pods should not be marked as failing since they respawn

**What this PR does / why we need it**: Juju deployments should not report evicted pods as failing.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```NONE

```
This commit is contained in:
Kubernetes Submit Queue 2017-12-20 11:42:33 -08:00 committed by GitHub
commit 8d309aa04c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1241,7 +1241,9 @@ def all_kube_system_pods_running():
result = json.loads(output)
for pod in result['items']:
status = pod['status']['phase']
if status != 'Running':
# Evicted nodes should re-spawn
if status != 'Running' and \
pod['status'].get('reason', '') != 'Evicted':
return False
return True