Skip to content

Commit

Permalink
fix: handle nil ptr error for empty kubeconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and moshloop committed Sep 19, 2024
1 parent 89dbe15 commit 0d9a726
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scrapers/kubernetes/informers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0d9a726

Please sign in to comment.