Skip to content

Commit 25cae74

Browse files
committed
Fix too specific error handling in http WaitUntilReady
1 parent 290309f commit 25cae74

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

wait/http.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import (
77
"fmt"
88
"net"
99
"net/http"
10-
"os"
1110
"strconv"
12-
"syscall"
1311
"time"
1412

1513
"github.com/docker/go-connections/nat"
@@ -80,7 +78,6 @@ func (ws *HTTPStrategy) WithAllowInsecure(allowInsecure bool) *HTTPStrategy {
8078
func ForHTTP(path string) *HTTPStrategy {
8179
return NewHTTPStrategy(path)
8280
}
83-
8481
// WaitUntilReady implements Strategy.WaitUntilReady
8582
func (ws *HTTPStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) (err error) {
8683
// limit context to startupTimeout
@@ -133,15 +130,8 @@ func (ws *HTTPStrategy) WaitUntilReady(ctx context.Context, target StrategyTarge
133130
resp, err := client.Do(req)
134131

135132
if err != nil {
136-
if v, ok := err.(*net.OpError); ok {
137-
if v2, ok := (v.Err).(*os.SyscallError); ok {
138-
if v2.Err == syscall.ECONNREFUSED {
139-
time.Sleep(100 * time.Millisecond)
140-
continue
141-
}
142-
}
143-
}
144-
return err
133+
time.Sleep(100 * time.Millisecond)
134+
continue
145135
}
146136

147137
if !ws.StatusCodeMatcher(resp.StatusCode) {

0 commit comments

Comments
 (0)