Skip to content

Commit 1bbee8c

Browse files
author
Takashi Kusumi
authored
Fix bug where container-state is ignored when no-follow specified (#210)
1 parent 2983c8f commit 1bbee8c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stern/list.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ func ListTargets(ctx context.Context, i corev1client.PodInterface, labelSelector
9999
var targets []*Target
100100
for i := range list.Items {
101101
filter.visit(&list.Items[i], func(t *Target, containerStateMatched bool) {
102-
targets = append(targets, t)
102+
if containerStateMatched {
103+
targets = append(targets, t)
104+
}
103105
})
104106
}
105107
return targets, nil

0 commit comments

Comments
 (0)