Skip to content

Commit

Permalink
Fix issue when listing daemonset pods
Browse files Browse the repository at this point in the history
  • Loading branch information
scoquelin committed Aug 8, 2024
1 parent 0ebc82b commit 125cac1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/nidhogg/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ func (h *Handler) getDaemonsetPods(ctx context.Context, nodeName string, ds Daem
}

matchingPods := make([]*corev1.Pod, 0)
for _, pod := range pods.Items {
for i, pod := range pods.Items {
for _, owner := range pod.OwnerReferences {
if owner.Name == ds.Name && pod.Spec.NodeName == nodeName {
matchingPods = append(matchingPods, &pod)
matchingPods = append(matchingPods, &pods.Items[i])
}
}
}
Expand Down

0 comments on commit 125cac1

Please sign in to comment.