Merge pull request #98635 from rkilingr/enhancement/slice-capacity-kubectl

Cleanup: Provides capacity for make slice
This commit is contained in:
Kubernetes Prow Robot 2021-03-09 01:54:59 -08:00 committed by GitHub
commit bce3863970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,7 @@ func (l *PodDeleteList) errors() []error {
failedPods[msg] = append(failedPods[msg], fmt.Sprintf("%s/%s", i.Pod.Namespace, i.Pod.Name))
}
}
errs := make([]error, 0)
errs := make([]error, 0, len(failedPods))
for msg, pods := range failedPods {
errs = append(errs, fmt.Errorf("cannot delete %s: %s", msg, strings.Join(pods, ", ")))
}