Skip to content

Commit

Permalink
add safe type conv (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmasi authored Jan 20, 2024
1 parent 0333295 commit 8910cd2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion topo/node/arista/arista.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ func (n *Node) CreateCRD(ctx context.Context) error {
return err
}
for e := range w.ResultChan() {
p := e.Object.(*corev1.Pod)
p, ok := e.Object.(*corev1.Pod)
if !ok {
continue
}
if p.Status.Phase == corev1.PodPending || p.Status.Phase == corev1.PodRunning {
break
}
Expand Down
10 changes: 8 additions & 2 deletions topo/node/nokia/nokia.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ func (n *Node) GenerateSelfSigned(ctx context.Context) error {
return err
}
for e := range w.ResultChan() {
p := e.Object.(*corev1.Pod)
p, ok := e.Object.(*corev1.Pod)
if !ok {
continue
}
if p.Status.Phase == corev1.PodRunning {
break
}
Expand Down Expand Up @@ -256,7 +259,10 @@ func (n *Node) Create(ctx context.Context) error {
return err
}
for e := range w.ResultChan() {
p := e.Object.(*corev1.Pod)
p, ok := e.Object.(*corev1.Pod)
if !ok {
continue
}
if p.Status.Phase == corev1.PodPending {
break
}
Expand Down

0 comments on commit 8910cd2

Please sign in to comment.