Fix: correct k8s service status check (#3753)

pull/3764/head
shamoon 5 months ago committed by GitHub
parent d6188e52fe
commit 407376b3b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -48,8 +48,8 @@ export default async function handler(req, res) {
logger.error(`no pods found with namespace=${namespace} and labelSelector=${labelSelector}`);
return;
}
const someReady = pods.find((pod) => pod.status.phase in ["Completed", "Running"]);
const allReady = pods.every((pod) => pod.status.phase in ["Completed", "Running"]);
const someReady = pods.find((pod) => ["Completed", "Running"].includes(pod.status.phase));
const allReady = pods.every((pod) => ["Completed", "Running"].includes(pod.status.phase));
let status = "down";
if (allReady) {
status = "running";

Loading…
Cancel
Save