File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed
src/supervisor/watchers/handlers Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -68,29 +68,21 @@ export async function handleReadyPod(
6868}
6969
7070export function isPodReady ( pod : V1Pod ) : boolean {
71- const podStatus = pod . status !== undefined ;
71+ const isTerminating = pod . metadata ?. deletionTimestamp !== undefined ;
7272 const podStatusPhase = pod . status ?. phase === PodPhase . Running ;
73- const podContainerStatuses = pod . status ?. containerStatuses !== undefined ;
74- const containerReadyStatuses = pod . status ?. containerStatuses ?. some (
75- ( container ) =>
76- container . state !== undefined &&
77- ( container . state . running !== undefined ||
78- container . state . waiting !== undefined ) ,
79- ) as boolean ;
73+ const containerReadyStatuses = Boolean (
74+ pod . status ?. containerStatuses ?. every (
75+ ( container ) => container . state ?. running !== undefined ,
76+ ) ,
77+ ) ;
8078
8179 const logContext = {
82- podStatus ,
80+ isTerminating ,
8381 podStatusPhase,
84- podContainerStatuses,
8582 containerReadyStatuses,
8683 } ;
8784 logger . debug ( logContext , 'checking to see if pod is ready to process' ) ;
88- return (
89- podStatus &&
90- podStatusPhase &&
91- podContainerStatuses &&
92- containerReadyStatuses
93- ) ;
85+ return ! isTerminating && podStatusPhase && containerReadyStatuses ;
9486}
9587
9688export async function paginatedNamespacedPodList ( namespace : string ) : Promise < {
You can’t perform that action at this time.
0 commit comments