File tree Expand file tree Collapse file tree 3 files changed +59
-2
lines changed
Expand file tree Collapse file tree 3 files changed +59
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ import (
2828 "os"
2929 "path"
3030 "strings"
31- "syscall"
3231
3332 "github.com/containerd/errdefs"
3433 "github.com/containerd/log"
@@ -778,7 +777,7 @@ func isTLSError(err error) bool {
778777}
779778
780779func isPortError (err error , host string ) bool {
781- if errors . Is (err , syscall . ECONNREFUSED ) || os .IsTimeout (err ) {
780+ if isConnError (err ) || os .IsTimeout (err ) {
782781 if _ , port , _ := net .SplitHostPort (host ); port != "" {
783782 // Port is specified, will not retry on different port with scheme change
784783 return false
Original file line number Diff line number Diff line change 1+ //go:build !windows
2+
3+ /*
4+ Copyright The containerd Authors.
5+
6+ Licensed under the Apache License, Version 2.0 (the "License");
7+ you may not use this file except in compliance with the License.
8+ You may obtain a copy of the License at
9+
10+ http://www.apache.org/licenses/LICENSE-2.0
11+
12+ Unless required by applicable law or agreed to in writing, software
13+ distributed under the License is distributed on an "AS IS" BASIS,
14+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ See the License for the specific language governing permissions and
16+ limitations under the License.
17+ */
18+
19+ package docker
20+
21+ import (
22+ "errors"
23+ "syscall"
24+ )
25+
26+ func isConnError (err error ) bool {
27+ return errors .Is (err , syscall .ECONNREFUSED )
28+ }
Original file line number Diff line number Diff line change 1+ //go:build windows
2+
3+ /*
4+ Copyright The containerd Authors.
5+
6+ Licensed under the Apache License, Version 2.0 (the "License");
7+ you may not use this file except in compliance with the License.
8+ You may obtain a copy of the License at
9+
10+ http://www.apache.org/licenses/LICENSE-2.0
11+
12+ Unless required by applicable law or agreed to in writing, software
13+ distributed under the License is distributed on an "AS IS" BASIS,
14+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ See the License for the specific language governing permissions and
16+ limitations under the License.
17+ */
18+
19+ package docker
20+
21+ import (
22+ "errors"
23+ "syscall"
24+
25+ "golang.org/x/sys/windows"
26+ )
27+
28+ func isConnError (err error ) bool {
29+ return errors .Is (err , syscall .ECONNREFUSED ) || errors .Is (err , windows .WSAECONNREFUSED )
30+ }
You can’t perform that action at this time.
0 commit comments