Skip to content

Commit 0d0af48

Browse files
committed
Fix changes
1 parent 87e7d77 commit 0d0af48

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -321,17 +321,13 @@ func (c *AvailableConditionController) sync(key string) error {
321321
// we had trouble with slow dial and DNS responses causing us to wait too long.
322322
// we added this as insurance
323323
case <-time.After(6 * time.Second):
324-
defer func() {
325-
// errCh needs to have a reader since the above goroutine doing the work
326-
// needs to send to it. This is defered to ensure it runs
327-
// even if the post timeout work itself panics.
328-
go func() {
329-
res := <-errch
330-
if res != nil {
331-
fmt.Error("%v", res)
332-
}
333-
}()
334-
}()
324+
// errCh needs to have a reader since the above goroutine doing the work
325+
// needs to send to it.
326+
go func() {
327+
if res := <-errch; res != nil {
328+
fmt.Errorf("timed out response from %v: %v", discoveryURL, res)
329+
}
330+
}()
335331
results <- fmt.Errorf("timed out waiting for %v", discoveryURL)
336332
return
337333
}

0 commit comments

Comments
 (0)