You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):
DisruptionController
getPodsForPdb
Is this a BUG REPORT or FEATURE REQUEST? FEATURE REQUEST
in kubernetes/pkg/controller/disruption/disruption.go we have getPodsForPdb function return pods using policy.PodDisruptionBudget.
but at the end we perform a copy of the pod array that we listed with :
result:=make([]*v1.Pod, 0, len(pods))
fori:=rangepods {
result=append(result, &(*pods[i])) //pods being the array returned from the listing
}
adding comments stating that returned pods should be used as read-only objects
fixing typo
avoiding unnecessary loop to copy pods listed see kubernetes#46433
fixing fmt
avoiding unnecessary loop to copy pods listed see kubernetes#46433
Automatic merge from submit-queue
avoiding unnecessary loop to copy pods listed
**What this PR does / why we need it**: avoids unnecessary loop to copy pods listed
**Which issue this PR fixes** : fixes#46433
**Release note**:
```release-note
```
/assign @wojtek-t
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No.
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):
DisruptionController
getPodsForPdb
Is this a BUG REPORT or FEATURE REQUEST? FEATURE REQUEST
in
kubernetes/pkg/controller/disruption/disruption.go
we havegetPodsForPdb
function return pods usingpolicy.PodDisruptionBudget
.but at the end we perform a copy of the pod array that we listed with :
this is not necessary cc @deads2k @wojtek-t
The text was updated successfully, but these errors were encountered: