Skip to content

Commit

Permalink
fix: kill pods by finding their statefulset, not daemonset
Browse files Browse the repository at this point in the history
  • Loading branch information
YrrepNoj committed Jun 5, 2024
1 parent b7c680c commit 3fa4134
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pepr/operator/controllers/istio/injection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || ""));
}

Expand Down

0 comments on commit 3fa4134

Please sign in to comment.