mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 04:32:37 +00:00
reason key should exist
This commit is contained in:
@@ -1242,7 +1242,9 @@ def all_kube_system_pods_running():
|
||||
for pod in result['items']:
|
||||
status = pod['status']['phase']
|
||||
# Evicted nodes should re-spawn
|
||||
if status != 'Running' and pod['status']['reason'] != 'Evicted':
|
||||
if status != 'Running' and \
|
||||
('reason' in pod['status'].keys()
|
||||
and pod['status']['reason'] != 'Evicted'):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
Reference in New Issue
Block a user