From 0d9a7262a724b2c2715718daa4a95f3250028712 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Thu, 19 Sep 2024 17:22:46 +0530 Subject: [PATCH] fix: handle nil ptr error for empty kubeconfig --- scrapers/kubernetes/informers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrapers/kubernetes/informers.go b/scrapers/kubernetes/informers.go index 1173d9a4..38f43d57 100644 --- a/scrapers/kubernetes/informers.go +++ b/scrapers/kubernetes/informers.go @@ -108,7 +108,7 @@ func (t *SharedInformerManager) getOrCreate(ctx api.ScrapeContext, apiVersion, k defer t.mu.Unlock() cacheKey := apiVersion + kind - kubeconfig := ctx.KubernetesRestConfig().Host + kubeconfig := lo.FromPtr(ctx.KubernetesRestConfig()).Host if val, ok := t.cache[kubeconfig]; ok { if data, ok := val[cacheKey]; ok {