diff --git a/pkg/descheduler/strategies/duplicates.go b/pkg/descheduler/strategies/duplicates.go index d14582352..4d485e3c8 100644 --- a/pkg/descheduler/strategies/duplicates.go +++ b/pkg/descheduler/strategies/duplicates.go @@ -69,7 +69,7 @@ func RemoveDuplicatePods( duplicateKeysMap := map[string][][]string{} for _, pod := range pods { ownerRefList := podutil.OwnerRef(pod) - if hasExcludedOwnerRefKind(ownerRefList, strategy) { + if hasExcludedOwnerRefKind(ownerRefList, strategy) || len(ownerRefList) == 0 { continue } podContainerKeys := make([]string, 0, len(ownerRefList)*len(pod.Spec.Containers))