From 407376b3b7103ff8afb663b95c2d4719ab3a83f4 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 17 Jul 2024 23:04:50 -0700 Subject: [PATCH] Fix: correct k8s service status check (#3753) --- src/pages/api/kubernetes/status/[...service].js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/api/kubernetes/status/[...service].js b/src/pages/api/kubernetes/status/[...service].js index b25cd69da..e6091b653 100644 --- a/src/pages/api/kubernetes/status/[...service].js +++ b/src/pages/api/kubernetes/status/[...service].js @@ -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";