From ba06d2b211b3835476a390538126eaa23bd6bb99 Mon Sep 17 00:00:00 2001 From: Huabing Zhao Date: Thu, 12 Dec 2024 06:56:49 +0000 Subject: [PATCH] address comment Signed-off-by: Huabing Zhao --- internal/envoygateway/config/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/envoygateway/config/config.go b/internal/envoygateway/config/config.go index 0609f316acc..b08a09a829f 100644 --- a/internal/envoygateway/config/config.go +++ b/internal/envoygateway/config/config.go @@ -43,14 +43,16 @@ type Server struct { // New returns a Server with default parameters. func New() (*Server, error) { - return &Server{ + server:= &Server{ EnvoyGateway: egv1a1.DefaultEnvoyGateway(), Namespace: env.Lookup("ENVOY_GATEWAY_NAMESPACE", DefaultNamespace), DNSDomain: env.Lookup("KUBERNETES_CLUSTER_DOMAIN", DefaultDNSDomain), // the default logger Logger: logging.DefaultLogger(egv1a1.LogLevelInfo), Elected: &sync.WaitGroup{}, - }, nil + } + server.Elected.Add(1) + return server, nil } // Validate validates a Server config.