In this case expression pod.Spec.Affinity == nil is not valid, and Affinity is equal to &Affinity{NodeAffinity:nil,PodAffinity:nil,PodAntiAffinity:nil,}.
Affinity is still not set, so condition for Default Pod Selector is still met, however escalator will ignore such pods.
My PR extends NewPodDefaultFilterFunc() fixing this.
Some solutions such as Gitlab Runner (https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/common/config.go#L1093) if affinity is not especially set via configs will produce Pods with
affinity: {}
.In this case expression
pod.Spec.Affinity == nil
is not valid, and Affinity is equal to&Affinity{NodeAffinity:nil,PodAffinity:nil,PodAntiAffinity:nil,}
.Affinity is still not set, so condition for Default Pod Selector is still met, however escalator will ignore such pods.
My PR extends
NewPodDefaultFilterFunc()
fixing this.