-
Notifications
You must be signed in to change notification settings - Fork 1k
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
correct order (discovery clean-up part-2) #1497
correct order (discovery clean-up part-2) #1497
Conversation
@@ -187,7 +187,9 @@ private List<ServiceInstance> serviceInstances(EndpointSubsetNS es, String servi | |||
|
|||
@Override | |||
public List<String> getServices() { | |||
return adapter.apply(client).stream().map(s -> s.getMetadata().getName()).distinct().toList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change here is to add:
LOG.debug(() -> "will return services : " + services);
because the k8s client has such a debug log, and this one does not
endpoints = filteredEndpoints(client.endpoints().inAnyNamespace().withNewFilter(), properties, serviceName); | ||
} | ||
else if (!properties.namespaces().isEmpty()) { | ||
if (!properties.namespaces().isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is a bit subtle.
So when users call DiscoveryClient::getServices
, we provide a response based on this exact order:
- selective namespaces
- all namespaces
- namespace based on "namespace resolution"
depending on which property is enabled.
With that result, they will call getInstances
; but this time, as seen in this code, we will not use the abive order. Instead we will use:
- all namespaces
- selective namespaces
- namespace based on "namespace" resolution
It is highly unlikely that this can cause problems, and no one reported such a problem, nevertheless, this is a bug, imo.
@ryanjbaxter minor bug fix. Thank you |
No description provided.