From e69df3ccd7f8fc60731f45e1059e4ffc0bf44a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lia=20Barroso?= Date: Mon, 28 Oct 2024 20:47:21 +0000 Subject: [PATCH] [fix] lint --- internal/analyzers/prometheus.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/analyzers/prometheus.go b/internal/analyzers/prometheus.go index 3dbd4c9..510ea17 100644 --- a/internal/analyzers/prometheus.go +++ b/internal/analyzers/prometheus.go @@ -171,6 +171,10 @@ func checkPrometheusNamespaceSelectors(ctx context.Context, clientSets *k8sutil. namespaces, err := clientSets.KClient.CoreV1().Namespaces().List(ctx, metav1.ListOptions{LabelSelector: labels.SelectorFromSet(labelMap).String(),}) + if err != nil { + return fmt.Errorf("Failed to list Namespaces: %v", err) + } + if len(namespaces.Items) == 0 { return fmt.Errorf("No Namespaces match the provided selector") }