From 0702c7eb83d9f949d97879a4bdec76e83524105c Mon Sep 17 00:00:00 2001 From: Antonin Bas Date: Wed, 22 Jan 2025 11:55:09 -0800 Subject: [PATCH] Address review comments Signed-off-by: Antonin Bas --- docs/antrea-proxy.md | 2 +- pkg/agent/proxy/proxier.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/antrea-proxy.md b/docs/antrea-proxy.md index bc5a31e4159..f6310de9b28 100644 --- a/docs/antrea-proxy.md +++ b/docs/antrea-proxy.md @@ -77,7 +77,7 @@ E0117 19:38:17.586328 1 service_health.go:145] "Failed to start healthchec These log messages will keep repeating periodically, as kube-proxy handles Service updates. While the messages are harmless, they can create a lot of -necessary noise. You may want to set `antreaProxy.disableServiceHealthCheckServer: true` +unnecessary noise. You may want to set `antreaProxy.disableServiceHealthCheckServer: true` in the `antrea-config` ConfigMap to avoid such logs. It will instruct Antrea Proxy to stop running health check servers and shift this responsibility to kube-proxy. This is not a perfect solution as ideally the component responsible diff --git a/pkg/agent/proxy/proxier.go b/pkg/agent/proxy/proxier.go index f95988ee50a..05f8410af7f 100644 --- a/pkg/agent/proxy/proxier.go +++ b/pkg/agent/proxy/proxier.go @@ -1383,13 +1383,13 @@ func newProxier( var serviceHealthServer healthcheck.ServiceHealthServer if proxyAllEnabled { - nodePortAddressesString := make([]string, len(nodePortAddresses)) - for i, address := range nodePortAddresses { - nodePortAddressesString[i] = address.String() - } if serviceHealthServerDisabled { klog.V(2).InfoS("Service health check server will not be run") } else { + nodePortAddressesString := make([]string, len(nodePortAddresses)) + for i, address := range nodePortAddresses { + nodePortAddressesString[i] = address.String() + } serviceHealthServer = healthcheck.NewServiceHealthServer(hostname, nil, nodePortAddressesString) } }