Skip to content

Commit 9725061

Browse files
stttsgmarek
authored and
gmarek
committed
Workaround tcpv4-only-systems connect issue in test
Fixes kubernetes#47304. Workarounds golang/go#18806 (fixed in Go 1.9+).
1 parent 7d59f00 commit 9725061

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
@@ -1444,7 +1444,11 @@ func tlsHandshake(t *testing.T, sCfg, cCfg *tls.Config) error {
14441444
}
14451445
}()
14461446

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

0 commit comments

Comments
 (0)