File tree Expand file tree Collapse file tree 1 file changed +16
-17
lines changed
Expand file tree Collapse file tree 1 file changed +16
-17
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments