1
0
spogulis no https://github.com/karl0ss/homepage.git synced 2025-07-13 02:36:06 +01:00

Fix: correct k8s service status check (#3753)

Šī revīzija ir iekļauta:
shamoon 2024-07-17 23:04:50 -07:00 revīziju iesūtīja GitHub
vecāks d6188e52fe
revīzija 407376b3b7
Šim parakstam datu bāzē netika atrasta zināma atslēga
GPG atslēgas ID: B5690EEEBB952194

Parādīt failu

@ -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 in ["Completed", "Running"]); const someReady = pods.find((pod) => ["Completed", "Running"].includes(pod.status.phase));
const allReady = pods.every((pod) => pod.status.phase in ["Completed", "Running"]); const allReady = pods.every((pod) => ["Completed", "Running"].includes(pod.status.phase));
let status = "down"; let status = "down";
if (allReady) { if (allReady) {
status = "running"; status = "running";