From 44bc2c18d90eb1e91265e5d8803aa3a7143811c8 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Wed, 30 Oct 2024 08:41:10 -0400 Subject: [PATCH] Address identical functions in RA health checker RemoteEndpointCreated and RemoteEndpointUpdated are identical and is reported by Sonar as an issue. Change one to call the other. Signed-off-by: Tom Pantelis --- .../handlers/healthchecker/healthchecker.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/routeagent_driver/handlers/healthchecker/healthchecker.go b/pkg/routeagent_driver/handlers/healthchecker/healthchecker.go index 1701605f9..8c9a6ac34 100644 --- a/pkg/routeagent_driver/handlers/healthchecker/healthchecker.go +++ b/pkg/routeagent_driver/handlers/healthchecker/healthchecker.go @@ -98,16 +98,7 @@ func (h *controller) Stop() error { } func (h *controller) RemoteEndpointCreated(endpoint *submarinerv1.Endpoint) error { - h.Lock() - defer h.Unlock() - - if !h.config.HealthCheckerEnabled || h.State().IsOnGateway() { - return nil - } - - h.processEndpointCreatedOrUpdated(endpoint) - - return nil + return h.RemoteEndpointUpdated(endpoint) } func (h *controller) RemoteEndpointUpdated(endpoint *submarinerv1.Endpoint) error {