Merge pull request #117780 from sourcelliu/schedulinggates

Improve the performance of schedulinggates
This commit is contained in:
Kubernetes Prow Robot 2023-10-26 18:14:32 +02:00 committed by GitHub
commit 53e91942bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@ func (pl *SchedulingGates) PreEnqueue(ctx context.Context, p *v1.Pod) *framework
if !pl.enablePodSchedulingReadiness || len(p.Spec.SchedulingGates) == 0 {
return nil
}
var gates []string
gates := make([]string, 0, len(p.Spec.SchedulingGates))
for _, gate := range p.Spec.SchedulingGates {
gates = append(gates, gate.Name)
}