From 2fbe9aa03d3b5f6b4a3676c5279eea99a0e33622 Mon Sep 17 00:00:00 2001 From: neilblaze Date: Sat, 11 Mar 2023 19:05:49 +0530 Subject: [PATCH] fix update v1.1.2 --- connectivity/tests/host.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/connectivity/tests/host.go b/connectivity/tests/host.go index b18698582a..e62e448450 100644 --- a/connectivity/tests/host.go +++ b/connectivity/tests/host.go @@ -38,7 +38,11 @@ func (s *podToHost) Run(ctx context.Context, t *check.Test) { var ipFamStr string t.ForEachIPFamily(func(ipFam check.IPFamily) { - ipFamStr = ipFam == check.IPFamilyV4 ? "v4" : "v6" + if ipFam == check.IPFamilyV4 { + ipFamStr = "v4" + } else if ipFam == check.IPFamilyV6 { + ipFamStr = "v6" + } for _, addr := range node.Status.Addresses { if check.GetIPFamily(addr.Address) != ipFam { @@ -95,7 +99,11 @@ func (s *podToHostPort) Run(ctx context.Context, t *check.Test) { var ipFamStr string t.ForEachIPFamily(func(ipFam check.IPFamily) { - ipFamStr = ipFam == check.IPFamilyV4 ? "v4" : "v6" + if ipFam == check.IPFamilyV4 { + ipFamStr = "v4" + } else if ipFam == check.IPFamilyV6 { + ipFamStr = "v6" + } baseURL := fmt.Sprintf("%s://%s:%d%s", echo.Scheme(), echo.Pod.Status.HostIP, check.EchoServerHostPort, echo.Path()) ep := check.HTTPEndpoint(echo.Name(), baseURL)