Skip to content

Commit

Permalink
add check for readiness probe status
Browse files Browse the repository at this point in the history
  • Loading branch information
sotojn committed Aug 20, 2024
1 parent 3400564 commit 68ae965
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,16 @@ export class K8s {
}

if (pod) {
if (get(pod, 'status.phase') === 'Running') return pod;
if (pod.status?.conditions) {
for (const condition of pod.status.conditions) {
if (
condition.type === 'ContainersReady'
&& condition.status === 'True'
) {
return pod;
}
}
}
}
if (now > end) throw new Error(`Timeout waiting for pod matching: ${selector}`);
this.logger.debug(`waiting for pod matching: ${selector}`);
Expand Down

0 comments on commit 68ae965

Please sign in to comment.