mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user