DiscoveryClient allNamespaces Property Not Used When Querying Services
See original GitHub issueThis relates to #428 .
There was a change made to configure the discovery client to search across all namespaces based on a property. Inside KubernetesDiscoveryClient,getInstances
the method call which queries the endpoints was updated to use this new property
this.properties.isAllNamespaces()
? this.client.endpoints().isAllNamespaces()
.withField("metadata.name", serviceId).list().getItems()
: Collections
.singletonList(this.client.endpoints().withName(serviceId).get());
However, the same change was not applied later in the same method when the services are queried. The current code is:
this.client.services().withName(serviceId).get();
As a result, when trying to use the isAllNamespaces
property we are consistently getting null pointer exceptions.
It seems like the call to query the services should also use the isAllNamespaces
method when the property is set.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
138. DiscoveryClient for Kubernetes - Spring Cloud
This client lets you query Kubernetes endpoints (see services) by name. A service is typically exposed by the Kubernetes API server as a...
Read more >HashiCorp Consul - Steeltoe Documentation
HashiCorp Consul. The Consul client implementation lets applications register services with a Consul server and discover services registered by other ...
Read more >awesome-mirror/spring-cloud-kubernetes - Gitee
This project provides an implementation of Discovery Client for Kubernetes. This client lets you query Kubernetes endpoints (see services) by name.
Read more >Spring Cloud Kubernetes Persistence | by Amit Kumar - Medium
If you have not gone through that then you can refer to the following link to ... Discovery Client to do the service...
Read more >Guide to Spring Cloud Kubernetes - Baeldung
In our example, we're using the scenario of travel agents offering various deals to clients who will query the travel agents service from ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Haybu made the changes, I am sure he will take a look 😃
Fixed via d9bad61