Skip to content

Commit 125cac1

Browse files
committed
Fix issue when listing daemonset pods
1 parent 0ebc82b commit 125cac1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/nidhogg/handler.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ func (h *Handler) getDaemonsetPods(ctx context.Context, nodeName string, ds Daem
250250
}
251251

252252
matchingPods := make([]*corev1.Pod, 0)
253-
for _, pod := range pods.Items {
253+
for i, pod := range pods.Items {
254254
for _, owner := range pod.OwnerReferences {
255255
if owner.Name == ds.Name && pod.Spec.NodeName == nodeName {
256-
matchingPods = append(matchingPods, &pod)
256+
matchingPods = append(matchingPods, &pods.Items[i])
257257
}
258258
}
259259
}

0 commit comments

Comments
 (0)