Skip to content

Commit

Permalink
Handle case where returned object from a Watch is not a Pod (adobe#132)
Browse files Browse the repository at this point in the history
* Handle cases where returned object from a watch is not a Pod
  • Loading branch information
harjsing7 authored and arturo-skydio committed Oct 5, 2023
1 parent e9895e2 commit 7a30fa3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion testing/it_sidecar/stern/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ func Watch(ctx context.Context, i v1.PodInterface, podFilter *regexp.Regexp, con
return
}

pod := e.Object.(*corev1.Pod)
var (
pod *corev1.Pod
ok bool
)
if pod, ok = e.Object.(*corev1.Pod); !ok {
continue
}

if !podFilter.MatchString(pod.Name) {
continue
Expand Down

0 comments on commit 7a30fa3

Please sign in to comment.