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

get the namespace from the endpoints instead of the client #1230

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

wind57
Copy link
Contributor

@wind57 wind57 commented Feb 18, 2023

No description provided.

@@ -49,11 +48,8 @@ private KubernetesDiscoveryClientUtils() {

}

static EndpointSubsetNS subsetsFromEndpoints(Endpoints endpoints, Supplier<String> clientNamespace) {
Copy link
Contributor Author

@wind57 wind57 Feb 18, 2023

Choose a reason for hiding this comment

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

now that I have a bit cleaned-up and refactored the code, I can understand better what is going on and make some fixes, not just clean-ups.

This method is called after we find endpoints in different namespace, there is no way for endpoints to be null here, so the check for endpoints != null is obsolete.

Also, endpoints.getSubsets() can not be null either, as the "default" value from fabric8 for getSubsets is an empty List. As such, I dropped these checks altogether.

Then the last point is that getting the namespace from the client is not correct, as we query for endpoints is various namespaces, so the only correct way is to get it from the endpoints itself.

@wind57 wind57 changed the title fix get the namespace from the endpoints instead of the client Feb 18, 2023
@wind57 wind57 marked this pull request as ready for review February 18, 2023 08:32
@wind57
Copy link
Contributor Author

wind57 commented Feb 19, 2023

@ryanjbaxter ready to be looked at, thank you.

@ryanjbaxter ryanjbaxter added this to the 3.0.2 milestone Feb 20, 2023
@ryanjbaxter ryanjbaxter merged commit 2c25137 into spring-cloud:main Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants