Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore] specify the capacity on calling make #2719

Conversation

fscnick
Copy link
Contributor

@fscnick fscnick commented Jan 8, 2025

Why are these changes needed?

The slice only appends at most one time because the following loop breaks once condition matched. It would be better to specify the capacity in advance.

ports := []corev1.ServicePort{}
for name, port := range portsInt {
if name == utils.ServingPortName {
svcPort := corev1.ServicePort{Name: name, Port: port}
ports = append(ports, svcPort)
break
}
}

ports := []corev1.ServicePort{}
for _, port := range serveService.Spec.Ports {
if port.Name == utils.ServingPortName {
svcPort := corev1.ServicePort{Name: port.Name, Port: port.Port}
ports = append(ports, svcPort)
break
}
}

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@kevin85421 kevin85421 merged commit 5db3012 into ray-project:master Jan 9, 2025
24 checks passed
@fscnick fscnick deleted the chore/specify-the-capacity-on-calling-make branch January 9, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants