Skip to content

Commit

Permalink
Address identical functions in RA health checker
Browse files Browse the repository at this point in the history
RemoteEndpointCreated and RemoteEndpointUpdated are identical
and is reported by Sonar as an issue. Change one to call the other.

Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis authored and skitt committed Nov 11, 2024
1 parent b790725 commit 44bc2c1
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/routeagent_driver/handlers/healthchecker/healthchecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 44bc2c1

Please sign in to comment.