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 Apr 17, 2023
1 parent eafc9c3 commit 00b155e
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 00b155e

Please sign in to comment.