From cc5dc3e141b854a6f918a67cb43384ca8699d396 Mon Sep 17 00:00:00 2001 From: Jan Jansen Date: Wed, 28 Jun 2023 10:47:23 +0200 Subject: [PATCH] recover for most issues Signed-off-by: Jan Jansen --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a0e54ab..ddf279e 100644 --- a/main.go +++ b/main.go @@ -102,14 +102,17 @@ func getMetrics(interval time.Duration, cs *kubernetes.Clientset) { for { nodes, err := cs.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{}) if err != nil { - log.Fatalf("ErrorBadRequst : %s", err.Error()) + log.Errorf("ErrorBadRequst : %s", err.Error()) + time.Sleep(time.Second * 60) + continue } var pods []ephemeralStoragePodData for i := range nodes.Items { currentNode := nodes.Items[i].Name node, err := scrapeSingleNode(cs, currentNode) if err != nil { - log.Fatalf("ErrorBadRequst : %s", err.Error()) + log.Errorf("ErrorBadRequst : %s", err.Error()) + continue } pods = append(pods, node...) }