Skip to content

Commit 2acc225

Browse files
committed
chore(controller): pod CrashLoopBackOff, release should be crash
1 parent 8703034 commit 2acc225

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • rootfs/scheduler/resources

rootfs/scheduler/resources/pod.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,14 +524,14 @@ def _handle_pod_errors(self, pod, reason, message):
524524
'RegistryUnavailable',
525525
'ErrImageInspect',
526526
"CreateContainerError",
527+
"CrashLoopBackOff",
527528
]
528529
# Image event reason mapping
529530
event_errors = {
530531
"Failed": "FailedToPullImage",
531532
"InspectFailed": "FailedToInspectImage",
532533
"ErrImageNeverPull": "ErrImageNeverPullPolicy",
533-
# Not including this one for now as the message is not useful
534-
# "BackOff": "BackOffPullImage",
534+
"BackOff": "CrashLoopBackOff",
535535
# FailedScheduling relates limits
536536
"FailedScheduling": "FailedScheduling",
537537
}
@@ -593,7 +593,13 @@ def _handle_pending_pods(self, namespace, labels):
593593
pods = []
594594
for pod in pods:
595595
# only care about pods that are not starting or in the starting phases
596-
if pod['status']['phase'] not in ['Pending', 'ContainerCreating']:
596+
phase = pod['status']['phase']
597+
name = '{}-{}'.format(pod['metadata']['labels']['app'],
598+
pod['metadata']['labels']['type'])
599+
container = self.find_container(name, pod['status']['containerStatuses'])
600+
# phase is Running, but state is waiting in CrashLoopBackOff
601+
if phase not in ['Pending', 'ContainerCreating'] and \
602+
(phase == 'Running' and 'waiting' not in container['state'].keys()):
597603
continue
598604

599605
# Get more information on why a pod is pending

0 commit comments

Comments
 (0)