From 385d1790a9f98524de616ff0a4b68ee234117ee8 Mon Sep 17 00:00:00 2001 From: Alexander Yastrebov Date: Fri, 11 Oct 2024 16:50:16 +0200 Subject: [PATCH] dataclients/kubernetes: add resource URI to error message (#3268) 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)