Skip to content

Commit 4979aff

Browse files
stttsenisoc
authored andcommitted
Workaround tcpv4-only-systems connect issue in test
Fixes kubernetes#47304. Workarounds golang/go#18806 (fixed in Go 1.9+).
1 parent 8049a92 commit 4979aff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

federation/pkg/kubefed/init/init_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,11 @@ func tlsHandshake(t *testing.T, sCfg, cCfg *tls.Config) error {
13761376
}
13771377
}()
13781378

1379-
c, err := tls.Dial("tcp", s.Addr().String(), cCfg)
1379+
// workaround [::] not working in ipv4 only systems (https://github.com/golang/go/issues/18806)
1380+
// TODO: remove with Golang 1.9 with https://go-review.googlesource.com/c/45088/
1381+
addr := strings.TrimPrefix(s.Addr().String(), "[::]")
1382+
1383+
c, err := tls.Dial("tcp", addr, cCfg)
13801384
if err != nil {
13811385
// Intentionally not serializing the error received because we want to
13821386
// test for the failure case in the caller test function.

0 commit comments

Comments
 (0)