From a26a1d589999e7c39b65ddb704ce327069e8fec8 Mon Sep 17 00:00:00 2001 From: Jon Perry Date: Wed, 5 Jun 2024 11:15:18 -0400 Subject: [PATCH] fix: kill pods by finding their statefulset, not daemonset --- src/pepr/operator/controllers/istio/injection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pepr/operator/controllers/istio/injection.ts b/src/pepr/operator/controllers/istio/injection.ts index 5859743a4..36102cff3 100644 --- a/src/pepr/operator/controllers/istio/injection.ts +++ b/src/pepr/operator/controllers/istio/injection.ts @@ -137,8 +137,8 @@ async function killPods(ns: string, enableInjection: boolean) { // Delete each group of pods for (const group of Object.values(groups)) { - // If this is a daemonset, delete the pods in reverse name order - if (group[0].metadata?.ownerReferences?.find(ref => ref.kind === "DaemonSet")) { + // If this is a statefulset, delete the pods in reverse name order + if (group[0].metadata?.ownerReferences?.find(ref => ref.kind === "StatefulSet")) { group.sort((a, b) => (b.metadata?.name || "").localeCompare(a.metadata?.name || "")); }