Fix issue #936: Kubernetes service discovery provider doesn't allow cross-namespace discovery (#938)

* Allow default k8s namespace to be overridden

* Add ServiceNamespace to ReRoute configuration

* Remove debug comments

* Update unit tests

* Unit tests (Eureka)

* Update docs

* Re-run build
This commit is contained in:
Jason Morton
2019-06-25 04:08:18 +01:00
committed by Thiago Loureiro
parent 959a92ec6a
commit e1d7f28951
13 changed files with 65 additions and 20 deletions

View File

@@ -6,13 +6,13 @@
public static class EurekaProviderFactory
{
public static ServiceDiscoveryFinderDelegate Get = (provider, config, name) =>
public static ServiceDiscoveryFinderDelegate Get = (provider, config, reRoute) =>
{
var client = provider.GetService<IDiscoveryClient>();
if (config.Type?.ToLower() == "eureka" && client != null)
{
return new Eureka(name, client);
return new Eureka(reRoute.ServiceName, client);
}
return null;