question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DiscoveryClient allNamespaces Property Not Used When Querying Services

See original GitHub issue

This 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:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ryanjbaxtercommented, Sep 12, 2019

@Haybu made the changes, I am sure he will take a look 😃

0reactions
ryanjbaxtercommented, Sep 18, 2019

Fixed via d9bad61

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found