Merge branch '3.0.x'
This commit is contained in:
@@ -46,7 +46,6 @@ import org.springframework.cloud.kubernetes.commons.config.KubernetesConfigServe
|
||||
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties;
|
||||
import org.springframework.core.env.AbstractEnvironment;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
import static org.springframework.cloud.kubernetes.client.KubernetesClientUtils.kubernetesApiClient;
|
||||
|
||||
@@ -57,7 +56,7 @@ class KubernetesClientConfigServerBootstrapper extends KubernetesConfigServerBoo
|
||||
|
||||
@Override
|
||||
public void initialize(BootstrapRegistry registry) {
|
||||
if (!ClassUtils.isPresent("org.springframework.cloud.config.client.ConfigServerInstanceProvider", null)) {
|
||||
if (hasConfigServerInstanceProvider()) {
|
||||
return;
|
||||
}
|
||||
// We need to pass a lambda here rather than create a new instance of
|
||||
@@ -96,7 +95,7 @@ class KubernetesClientConfigServerBootstrapper extends KubernetesConfigServerBoo
|
||||
.getInstances(serviceId);
|
||||
}
|
||||
|
||||
protected KubernetesConfigServerInstanceProvider getInstanceProvider(
|
||||
private KubernetesConfigServerInstanceProvider getInstanceProvider(
|
||||
KubernetesDiscoveryProperties discoveryProperties, KubernetesClientProperties clientProperties,
|
||||
BootstrapContext context, Binder binder, BindHandler bindHandler, Log log) {
|
||||
if (context.isRegistered(KubernetesInformerDiscoveryClient.class)) {
|
||||
@@ -116,12 +115,12 @@ class KubernetesClientConfigServerBootstrapper extends KubernetesConfigServerBoo
|
||||
|
||||
String namespace = getInformerNamespace(kubernetesNamespaceProvider, discoveryProperties);
|
||||
SharedInformerFactory sharedInformerFactory = new SharedInformerFactory(apiClient);
|
||||
final GenericKubernetesApi<V1Service, V1ServiceList> servicesApi = new GenericKubernetesApi<>(
|
||||
V1Service.class, V1ServiceList.class, "", "v1", "services", apiClient);
|
||||
GenericKubernetesApi<V1Service, V1ServiceList> servicesApi = new GenericKubernetesApi<>(V1Service.class,
|
||||
V1ServiceList.class, "", "v1", "services", apiClient);
|
||||
SharedIndexInformer<V1Service> serviceSharedIndexInformer = sharedInformerFactory
|
||||
.sharedIndexInformerFor(servicesApi, V1Service.class, 0L, namespace);
|
||||
Lister<V1Service> serviceLister = new Lister<>(serviceSharedIndexInformer.getIndexer());
|
||||
final GenericKubernetesApi<V1Endpoints, V1EndpointsList> endpointsApi = new GenericKubernetesApi<>(
|
||||
GenericKubernetesApi<V1Endpoints, V1EndpointsList> endpointsApi = new GenericKubernetesApi<>(
|
||||
V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient);
|
||||
SharedIndexInformer<V1Endpoints> endpointsSharedIndexInformer = sharedInformerFactory
|
||||
.sharedIndexInformerFor(endpointsApi, V1Endpoints.class, 0L, namespace);
|
||||
|
||||
Reference in New Issue
Block a user