podresources: partially revert PR135485

Partially reverts https://github.com/kubernetes/kubernetes/pull/135485

We had a FG to explicitly provide backward compatible behavior for
a underspecified flow. PR#135485 wanted to deflake tests, but
the unwanted side effect was to make the two flows in both sides of the
FG almost identical. This makes the whole point of having a FG moot,
but we promised a period on which we enable to revert the behavior
and report issues.

This was noticed while inspecting the podresources API lane
when checking the graduation: https://github.com/kubernetes/enhancements/pull/5875

Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
Francesco Romani
2026-02-10 17:13:40 +01:00
parent d863fbe80b
commit 5cb2b7958c

View File

@@ -67,17 +67,7 @@ func (p *v1PodResourcesServer) List(ctx context.Context, req *podresourcesv1.Lis
// GetActivePods already filters out terminal pods, so no need for additional filtering.
pods = p.podsProvider.GetActivePods()
} else {
// GetPods may include terminal pods, so we filter them out ourselves.
allPods := p.podsProvider.GetPods()
pods = make([]*v1.Pod, 0, len(allPods))
for _, pod := range allPods {
// Skip terminal pods (Failed or Succeeded).
// Terminal pods should not appear in podresources as they no longer consume resources.
if podutil.IsPodTerminal(pod) {
continue
}
pods = append(pods, pod)
}
pods = p.podsProvider.GetPods()
}
podResources := make([]*podresourcesv1.PodResources, len(pods))