Fix: don't show "partial" for k8s status if there are completed job pods (#3735)

pull/3737/head
Charles Thomas 4 months ago committed by GitHub
parent 95ab0706b6
commit 0d7072beea
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}`); logger.error(`no pods found with namespace=${namespace} and labelSelector=${labelSelector}`);
return; return;
} }
const someReady = pods.find((pod) => pod.status.phase === "Running"); const someReady = pods.find((pod) => pod.status.phase in ["Completed", "Running"]);
const allReady = pods.every((pod) => pod.status.phase === "Running"); const allReady = pods.every((pod) => pod.status.phase in ["Completed", "Running"]);
let status = "down"; let status = "down";
if (allReady) { if (allReady) {
status = "running"; status = "running";

Loading…
Cancel
Save