Skip to content

Commit

Permalink
Fix: correct k8s service status check (gethomepage#3753)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon authored Jul 18, 2024
1 parent d6188e5 commit 407376b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/api/kubernetes/status/[...service].js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 407376b

Please sign in to comment.