From 78f5e4c428ac56f74b442621de51d605a793efb1 Mon Sep 17 00:00:00 2001 From: Raihan Khan Date: Mon, 3 Jun 2024 18:06:40 +0600 Subject: [PATCH] Update rabbitmq client methods (#113) Signed-off-by: raihankhan --- rabbitmq/http_client.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rabbitmq/http_client.go b/rabbitmq/http_client.go index 11abf061..d3a02d9b 100644 --- a/rabbitmq/http_client.go +++ b/rabbitmq/http_client.go @@ -106,14 +106,16 @@ func (c *HTTPClient) IsNodePrimaryReplica(queues []rabbithole.QueueInfo, node st return false } -func (c *HTTPClient) GetNodeNameFromPodURL(url string) string { +func (c *HTTPClient) GetNodeNameFromPodURL(url string) (string, error) { podClient, err := rabbithole.NewClient(url, c.Username, c.Password) if err != nil { - return "" + klog.Error(err, "Failed to create new client for pod url", url) + return "", err } overview, err := podClient.Overview() if err != nil { - return "" + klog.Error(err, "Failed to get node overview from node client", url) + return "", err } - return overview.Node + return overview.Node, nil }