From 5db3012d4414c2d93931f3dd5d8b29d22b757769 Mon Sep 17 00:00:00 2001 From: fscnick <6858627+fscnick@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:39:38 +0800 Subject: [PATCH] [Chore] specify the capacity on calling make (#2719) Signed-off-by: fscnick --- ray-operator/controllers/ray/common/service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ray-operator/controllers/ray/common/service.go b/ray-operator/controllers/ray/common/service.go index 70ddeaa428..473e5d0e25 100644 --- a/ray-operator/controllers/ray/common/service.go +++ b/ray-operator/controllers/ray/common/service.go @@ -211,7 +211,7 @@ func BuildServeService(ctx context.Context, rayService rayv1.RayService, rayClus // `portsInt` is a map of port names to port numbers, while `ports` is a list of ServicePort objects portsInt := getServicePorts(rayCluster) - ports := []corev1.ServicePort{} + ports := make([]corev1.ServicePort, 0, 1) for name, port := range portsInt { if name == utils.ServingPortName { svcPort := corev1.ServicePort{Name: name, Port: port} @@ -245,7 +245,7 @@ func BuildServeService(ctx context.Context, rayService rayv1.RayService, rayClus log.Info("port with name 'serve' already added. Ignoring user provided ports for serve service") serveService.Spec.Ports = ports } else { - ports := []corev1.ServicePort{} + ports := make([]corev1.ServicePort, 0, 1) for _, port := range serveService.Spec.Ports { if port.Name == utils.ServingPortName { svcPort := corev1.ServicePort{Name: port.Name, Port: port.Port}