Skip to content

Commit 00b155e

Browse files
authored
Handle case where returned object from a Watch is not a Pod (#132)
* Handle cases where returned object from a watch is not a Pod
1 parent eafc9c3 commit 00b155e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

testing/it_sidecar/stern/watch.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ func Watch(ctx context.Context, i v1.PodInterface, podFilter *regexp.Regexp, con
5959
return
6060
}
6161

62-
pod := e.Object.(*corev1.Pod)
62+
var (
63+
pod *corev1.Pod
64+
ok bool
65+
)
66+
if pod, ok = e.Object.(*corev1.Pod); !ok {
67+
continue
68+
}
6369

6470
if !podFilter.MatchString(pod.Name) {
6571
continue

0 commit comments

Comments
 (0)