From 03584abf4550adb7cd9b1329fc2e7d564fc76b01 Mon Sep 17 00:00:00 2001 From: Alexander Yastrebov Date: Fri, 11 Oct 2024 16:19:06 +0200 Subject: [PATCH] dataclients/kubernetes: add resource URI to error message This is helpful for debugging k8s permissions. Signed-off-by: Alexander Yastrebov --- dataclients/kubernetes/clusterclient.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataclients/kubernetes/clusterclient.go b/dataclients/kubernetes/clusterclient.go index 451109e060..dbd64e00a7 100644 --- a/dataclients/kubernetes/clusterclient.go +++ b/dataclients/kubernetes/clusterclient.go @@ -278,7 +278,7 @@ func (c *clusterClient) getJSON(uri string, a interface{}) error { if rsp.StatusCode != http.StatusOK { log.Tracef("request failed, status: %d, %s", rsp.StatusCode, rsp.Status) - return fmt.Errorf("request failed, status: %d, %s", rsp.StatusCode, rsp.Status) + return fmt.Errorf("request to %s failed, status: %d, %s", uri, rsp.StatusCode, rsp.Status) } b := bytes.NewBuffer(nil)