Skip to content

Commit

Permalink
Update rabbitmq client methods (#113)
Browse files Browse the repository at this point in the history
Signed-off-by: raihankhan <[email protected]>
  • Loading branch information
raihankhan authored Jun 3, 2024
1 parent 8beb95c commit 78f5e4c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rabbitmq/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 78f5e4c

Please sign in to comment.