mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-28 06:29:29 +01:00
Merge pull request #369 from damemi/duplicates-panic
Add check for ownerref length in DuplicatePods strategy
This commit is contained in:
@@ -69,7 +69,7 @@ func RemoveDuplicatePods(
|
|||||||
duplicateKeysMap := map[string][][]string{}
|
duplicateKeysMap := map[string][][]string{}
|
||||||
for _, pod := range pods {
|
for _, pod := range pods {
|
||||||
ownerRefList := podutil.OwnerRef(pod)
|
ownerRefList := podutil.OwnerRef(pod)
|
||||||
if hasExcludedOwnerRefKind(ownerRefList, strategy) {
|
if hasExcludedOwnerRefKind(ownerRefList, strategy) || len(ownerRefList) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
podContainerKeys := make([]string, 0, len(ownerRefList)*len(pod.Spec.Containers))
|
podContainerKeys := make([]string, 0, len(ownerRefList)*len(pod.Spec.Containers))
|
||||||
|
|||||||
Reference in New Issue
Block a user