Skip to content

Commit b5785a7

Browse files
Update test/component_test.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 25c1131 commit b5785a7

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

test/component_test.go

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -161,25 +161,24 @@ func (s *ComponentSuite) TestBasic() {
161161

162162
informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
163163
UpdateFunc: func(oldObj, newObj interface{}) {
164-
_, ok := oldObj.(*networkingv1.Ingress)
165-
if !ok {
166-
return
167-
}
168-
newIngress, ok := newObj.(*networkingv1.Ingress)
169-
if !ok {
170-
return
171-
}
172-
173-
// Check if the Ingress's LoadBalancer status has been populated
174-
if len(newIngress.Status.LoadBalancer.Ingress[0].Hostname) > 0 {
175-
fmt.Printf("Ingress %s is ready\n", newIngress.Name)
164+
_, ok := oldObj.(*networkingv1.Ingress)
165+
if !ok {
166+
return
167+
}
168+
newIngress, ok := newObj.(*networkingv1.Ingress)
169+
if !ok {
170+
return
171+
}
172+
173+
// Check if the Ingress's LoadBalancer status has been populated
174+
if len(newIngress.Status.LoadBalancer.Ingress) > 0 && len(newIngress.Status.LoadBalancer.Ingress[0].Hostname) > 0 {
175+
fmt.Printf("Ingress %s is ready\n", newIngress.Name)
176176
close(stopChannel)
177-
} else {
178-
fmt.Printf("Ingress %s is not ready yet\n", newIngress.Name)
179-
}
180-
},
177+
} else {
178+
fmt.Printf("Ingress %s is not ready yet\n", newIngress.Name)
179+
}
180+
},
181181
})
182-
183182
go informer.Run(stopChannel)
184183

185184
select {

0 commit comments

Comments
 (0)