From 543e86b1f14a5a13cf2e99f4693dc3140c480210 Mon Sep 17 00:00:00 2001 From: Joe Talerico Date: Fri, 6 Oct 2023 14:41:53 -0400 Subject: [PATCH] Fixing HostNetwork Bug Signed-off-by: Joe Talerico --- cmd/k8s-netperf/k8s-netperf.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/k8s-netperf/k8s-netperf.go b/cmd/k8s-netperf/k8s-netperf.go index 6e32bcd2..860c8f58 100644 --- a/cmd/k8s-netperf/k8s-netperf.go +++ b/cmd/k8s-netperf/k8s-netperf.go @@ -332,7 +332,11 @@ func executeWorkload(nc config.Config, s config.PerfScenarios, hostNet bool, ipe serverIP = s.NetperfService.Spec.ClusterIP } } else { - serverIP = s.Server.Items[0].Status.PodIP + if hostNet { + serverIP = s.ServerHost.Items[0].Status.PodIP + } else { + serverIP = s.Server.Items[0].Status.PodIP + } } if !s.NodeLocal { Client = s.ClientAcross @@ -360,7 +364,7 @@ func executeWorkload(nc config.Config, s config.PerfScenarios, hostNet bool, ipe npr.AcrossAZ = nc.AcrossAZ } npr.StartTime = time.Now() - log.Debugf("Executing workloads. Server on %s client on %s, hostNetwork is %t, service is %t", s.ServerNodeInfo.Hostname, s.ClientNodeInfo.Hostname, hostNet, service) + log.Debugf("Executing workloads. hostNetwork is %t, service is %t", hostNet, service) for i := 0; i < nc.Samples; i++ { nr := sample.Sample{} if iperf3 {