Merge pull request #369 from damemi/duplicates-panic

Add check for ownerref length in DuplicatePods strategy
This commit is contained in:
Kubernetes Prow Robot
2020-08-10 07:06:20 -07:00
committed by GitHub
+1 -1
View File
@@ -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))