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

dataclients/kubernetes: add failing testcase for named service target port #2593

Conversation

AlexanderYastrebov
Copy link
Member

@AlexanderYastrebov AlexanderYastrebov commented Sep 13, 2023

For #2565

@AlexanderYastrebov AlexanderYastrebov changed the base branch from master to feature/endpointslices September 13, 2023 16:00
@AlexanderYastrebov AlexanderYastrebov changed the title Feature/endpointslices named target port dataclients/kubernetes: add failing testcase for named service target port Sep 13, 2023
ports:
- port: 80
protocol: TCP
targetPort: http-grafana
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here service uses named target port which could only be resolved by reading pod definition.

Endpoints logic has a special condition for a single port:

func (ep endpoint) targetsByServicePort(protocol string, servicePort *servicePort) []string {
for _, s := range ep.Subsets {
// If only one port exists in the endpoint, use it
if len(s.Ports) == 1 {
return formatEndpointsForSubsetAddresses(s.Addresses, s.Ports[0], protocol)
}
// Otherwise match port by name
for _, p := range s.Ports {

… port

For #2565

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
@AlexanderYastrebov AlexanderYastrebov force-pushed the feature/endpointslices-named-target-port branch from 3f555d8 to 4c72754 Compare September 18, 2023 13:03
@AlexanderYastrebov AlexanderYastrebov merged commit 4c72754 into feature/endpointslices Sep 18, 2023
2 of 4 checks passed
@AlexanderYastrebov AlexanderYastrebov deleted the feature/endpointslices-named-target-port branch September 18, 2023 13:05
@AlexanderYastrebov
Copy link
Member Author

Pushed to the #2565

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.

1 participant