Skip to content

Commit

Permalink
skip failed pods with UnsupportedPodSpec reason
Browse files Browse the repository at this point in the history
  • Loading branch information
alexei-led committed May 18, 2023
1 parent c7eaba9 commit 0604795
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0604795

Please sign in to comment.