From 0604795ad72738e591c3cd1f0a747daf206f1bb4 Mon Sep 17 00:00:00 2001 From: Alexei Ledenev Date: Thu, 18 May 2023 14:22:15 +0300 Subject: [PATCH] skip failed pods with UnsupportedPodSpec reason --- internal/controller/controller.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/controller/controller.go b/internal/controller/controller.go index 61a55f6..eb0371e 100644 --- a/internal/controller/controller.go +++ b/internal/controller/controller.go @@ -63,6 +63,14 @@ func (s *scanner) Run(ctx context.Context, log *logrus.Entry, nodeInformer Nodes "namespace": pod.Namespace, "name": pod.Name, }).Debug("pod deleted") + // skip "Failed" pods with UnsupportedPodSpec reason (e.g. DaemonSet pods on Fargate) + if pod.Status.Phase == v1.PodFailed && pod.Status.Reason == "UnsupportedPodSpec" { + log.WithFields(logrus.Fields{ + "namespace": pod.Namespace, + "name": pod.Name, + }).Debug("skipped failed pod with UnsupportedPodSpec") + return + } // get the node info from the cache node, ok := nodeInformer.GetNode(pod.Spec.NodeName) if !ok {