Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Workaround tcpv4-only-systems connect issue in test
Browse files Browse the repository at this point in the history
Fixes kubernetes/kubernetes#47304.

Workarounds golang/go#18806 (fixed in Go 1.9+).
  • Loading branch information
sttts committed Jul 10, 2017
1 parent 5564f08 commit f8ff562
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/kubefed/init/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,11 @@ func tlsHandshake(t *testing.T, sCfg, cCfg *tls.Config) error {
}
}()

c, err := tls.Dial("tcp", s.Addr().String(), cCfg)
// workaround [::] not working in ipv4 only systems (https://github.com/golang/go/issues/18806)
// TODO: remove with Golang 1.9 with https://go-review.googlesource.com/c/45088/
addr := strings.TrimPrefix(s.Addr().String(), "[::]")

c, err := tls.Dial("tcp", addr, cCfg)
if err != nil {
// Intentionally not serializing the error received because we want to
// test for the failure case in the caller test function.
Expand Down

0 comments on commit f8ff562

Please sign in to comment.