Skip to content

Commit

Permalink
Address type assertion possible panic in test code.
Browse files Browse the repository at this point in the history
  • Loading branch information
anathoodell committed Dec 5, 2024
1 parent 4440c8c commit 21d5b06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/shared/crclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ func (f Client) listPodList(list *corev1.PodList) error {
func (f Client) listNodeList(list *corev1.NodeList) error {
for k, v := range f.Objects {
if k.Kind == "Node" {
list.Items = append(list.Items, *v.(*corev1.Node))
node, ok := v.(*corev1.Node)
if ok {
list.Items = append(list.Items, *node)
}
}
}
return nil
Expand Down

0 comments on commit 21d5b06

Please sign in to comment.