Skip to content

Commit 6668367

Browse files
committed
fix
Signed-off-by: wind57 <[email protected]>
1 parent cfe690d commit 6668367

File tree

6 files changed

+178
-112
lines changed

6 files changed

+178
-112
lines changed

spring-cloud-kubernetes-client-discovery/src/main/java/org/springframework/cloud/kubernetes/client/discovery/KubernetesClientInformerAutoConfiguration.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@
5252
import static org.springframework.cloud.kubernetes.client.KubernetesClientUtils.getApplicationNamespace;
5353

5454
/**
55-
* This one uses: 'ConditionalOnBlockingOrReactiveDiscoveryEnabled' because beans it contains
56-
* are specific to both clients.
55+
* This one uses: 'ConditionalOnBlockingOrReactiveDiscoveryEnabled' because beans it
56+
* contains are specific to both clients.
57+
*
5758
* @author wind57
5859
*/
5960
@Configuration(proxyBeanMethods = false)
@@ -66,7 +67,7 @@
6667
final class KubernetesClientInformerAutoConfiguration {
6768

6869
private static final LogAccessor LOG = new LogAccessor(
69-
LogFactory.getLog(KubernetesClientInformerAutoConfiguration.class));
70+
LogFactory.getLog(KubernetesClientInformerAutoConfiguration.class));
7071

7172
// we rely on the order of namespaces to enable listers, as such provide a bean of
7273
// namespaces as a list, instead of the incoming Set.
@@ -104,16 +105,16 @@ List<SharedInformerFactory> sharedInformerFactories(ApiClient apiClient, List<St
104105

105106
@Bean
106107
@ConditionalOnMissingBean(value = V1Service.class,
107-
parameterizedContainer = { List.class, SharedIndexInformer.class })
108+
parameterizedContainer = { List.class, SharedIndexInformer.class })
108109
List<SharedIndexInformer<V1Service>> serviceSharedIndexInformers(
109-
List<SharedInformerFactory> sharedInformerFactories, List<String> selectiveNamespaces,
110-
ApiClient apiClient) {
110+
List<SharedInformerFactory> sharedInformerFactories, List<String> selectiveNamespaces,
111+
ApiClient apiClient) {
111112

112113
int howManyNamespaces = selectiveNamespaces.size();
113114
List<SharedIndexInformer<V1Service>> serviceSharedIndexedInformers = new ArrayList<>(howManyNamespaces);
114115
for (int i = 0; i < howManyNamespaces; ++i) {
115116
GenericKubernetesApi<V1Service, V1ServiceList> servicesApi = new GenericKubernetesApi<>(V1Service.class,
116-
V1ServiceList.class, "", "v1", "services", apiClient);
117+
V1ServiceList.class, "", "v1", "services", apiClient);
117118
SharedIndexInformer<V1Service> sharedIndexInformer = sharedInformerFactories.get(i)
118119
.sharedIndexInformerFor(servicesApi, V1Service.class, 0L, selectiveNamespaces.get(i));
119120
serviceSharedIndexedInformers.add(sharedIndexInformer);
@@ -124,7 +125,7 @@ List<SharedIndexInformer<V1Service>> serviceSharedIndexInformers(
124125
@Bean
125126
@ConditionalOnMissingBean(value = V1Service.class, parameterizedContainer = { List.class, Lister.class })
126127
List<Lister<V1Service>> serviceListers(List<String> selectiveNamespaces,
127-
List<SharedIndexInformer<V1Service>> serviceSharedIndexInformers) {
128+
List<SharedIndexInformer<V1Service>> serviceSharedIndexInformers) {
128129

129130
int howManyNamespaces = selectiveNamespaces.size();
130131
List<Lister<V1Service>> serviceListers = new ArrayList<>(howManyNamespaces);
@@ -141,16 +142,16 @@ List<Lister<V1Service>> serviceListers(List<String> selectiveNamespaces,
141142

142143
@Bean
143144
@ConditionalOnMissingBean(value = V1Endpoints.class,
144-
parameterizedContainer = { List.class, SharedIndexInformer.class })
145+
parameterizedContainer = { List.class, SharedIndexInformer.class })
145146
List<SharedIndexInformer<V1Endpoints>> endpointsSharedIndexInformers(
146-
List<SharedInformerFactory> sharedInformerFactories, List<String> selectiveNamespaces,
147-
ApiClient apiClient) {
147+
List<SharedInformerFactory> sharedInformerFactories, List<String> selectiveNamespaces,
148+
ApiClient apiClient) {
148149

149150
int howManyNamespaces = selectiveNamespaces.size();
150151
List<SharedIndexInformer<V1Endpoints>> endpointsSharedIndexedInformers = new ArrayList<>(howManyNamespaces);
151152
for (int i = 0; i < howManyNamespaces; ++i) {
152153
GenericKubernetesApi<V1Endpoints, V1EndpointsList> endpointsApi = new GenericKubernetesApi<>(
153-
V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient);
154+
V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient);
154155
SharedIndexInformer<V1Endpoints> sharedIndexInformer = sharedInformerFactories.get(i)
155156
.sharedIndexInformerFor(endpointsApi, V1Endpoints.class, 0L, selectiveNamespaces.get(i));
156157
endpointsSharedIndexedInformers.add(sharedIndexInformer);
@@ -161,7 +162,7 @@ List<SharedIndexInformer<V1Endpoints>> endpointsSharedIndexInformers(
161162
@Bean
162163
@ConditionalOnMissingBean(value = V1Endpoints.class, parameterizedContainer = { List.class, Lister.class })
163164
List<Lister<V1Endpoints>> endpointsListers(List<String> selectiveNamespaces,
164-
List<SharedIndexInformer<V1Endpoints>> serviceSharedIndexInformers) {
165+
List<SharedIndexInformer<V1Endpoints>> serviceSharedIndexInformers) {
165166

166167
int howManyNamespaces = selectiveNamespaces.size();
167168
List<Lister<V1Endpoints>> endpointsListers = new ArrayList<>(howManyNamespaces);

spring-cloud-kubernetes-client-discovery/src/main/java/org/springframework/cloud/kubernetes/client/discovery/KubernetesClientInformerDiscoveryClientAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import io.kubernetes.client.openapi.apis.CoreV1Api;
2626
import io.kubernetes.client.openapi.models.V1Endpoints;
2727
import io.kubernetes.client.openapi.models.V1Service;
28-
2928
import org.apache.commons.logging.LogFactory;
29+
3030
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
3131
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
3232
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
@@ -55,7 +55,7 @@
5555
final class KubernetesClientInformerDiscoveryClientAutoConfiguration {
5656

5757
private static final LogAccessor LOG = new LogAccessor(
58-
LogFactory.getLog(KubernetesClientInformerDiscoveryClientAutoConfiguration.class));
58+
LogFactory.getLog(KubernetesClientInformerDiscoveryClientAutoConfiguration.class));
5959

6060
@Bean
6161
@ConditionalOnMissingBean
@@ -71,7 +71,7 @@ KubernetesClientInformerDiscoveryClient kubernetesClientInformerDiscoveryClient(
7171
@Bean
7272
@ConditionalOnSpringCloudKubernetesBlockingDiscoveryHealthInitializer
7373
KubernetesDiscoveryClientHealthIndicatorInitializer indicatorInitializer(
74-
ApplicationEventPublisher applicationEventPublisher, PodUtils<?> podUtils) {
74+
ApplicationEventPublisher applicationEventPublisher, PodUtils<?> podUtils) {
7575
LOG.debug(() -> "Will publish InstanceRegisteredEvent from blocking implementation");
7676
return new KubernetesDiscoveryClientHealthIndicatorInitializer(podUtils, applicationEventPublisher);
7777
}

spring-cloud-kubernetes-client-discovery/src/main/java/org/springframework/cloud/kubernetes/client/discovery/KubernetesClientInformerReactiveDiscoveryClientAutoConfiguration.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ KubernetesClientInformerReactiveDiscoveryClient kubernetesClientReactiveDiscover
6969
List<Lister<V1Endpoints>> endpointsListers, List<SharedInformer<V1Service>> serviceInformers,
7070
List<SharedInformer<V1Endpoints>> endpointsInformers, KubernetesDiscoveryProperties properties,
7171
CoreV1Api coreV1Api, Predicate<V1Service> predicate) {
72-
KubernetesClientInformerDiscoveryClient kubernetesClientInformerDiscoveryClient =
73-
new KubernetesClientInformerDiscoveryClient(sharedInformerFactories, serviceListers, endpointsListers,
74-
serviceInformers, endpointsInformers, properties, coreV1Api, predicate);
72+
KubernetesClientInformerDiscoveryClient kubernetesClientInformerDiscoveryClient = new KubernetesClientInformerDiscoveryClient(
73+
sharedInformerFactories, serviceListers, endpointsListers, serviceInformers, endpointsInformers,
74+
properties, coreV1Api, predicate);
7575
return new KubernetesClientInformerReactiveDiscoveryClient(kubernetesClientInformerDiscoveryClient);
7676
}
7777

@@ -81,7 +81,7 @@ KubernetesClientInformerReactiveDiscoveryClient kubernetesClientReactiveDiscover
8181
@Bean
8282
@ConditionalOnSpringCloudKubernetesReactiveDiscoveryHealthInitializer
8383
KubernetesDiscoveryClientHealthIndicatorInitializer reactiveIndicatorInitializer(
84-
ApplicationEventPublisher applicationEventPublisher, PodUtils<?> podUtils) {
84+
ApplicationEventPublisher applicationEventPublisher, PodUtils<?> podUtils) {
8585
LOG.debug(() -> "Will publish InstanceRegisteredEvent from reactive implementation");
8686
return new KubernetesDiscoveryClientHealthIndicatorInitializer(podUtils, applicationEventPublisher);
8787
}
@@ -92,8 +92,8 @@ KubernetesDiscoveryClientHealthIndicatorInitializer reactiveIndicatorInitializer
9292
@Bean
9393
@ConditionalOnSpringCloudKubernetesReactiveDiscoveryHealthInitializer
9494
ReactiveDiscoveryClientHealthIndicator kubernetesReactiveDiscoveryClientHealthIndicator(
95-
KubernetesClientInformerReactiveDiscoveryClient client,
96-
DiscoveryClientHealthIndicatorProperties properties) {
95+
KubernetesClientInformerReactiveDiscoveryClient client,
96+
DiscoveryClientHealthIndicatorProperties properties) {
9797
return new ReactiveDiscoveryClientHealthIndicator(client, properties);
9898
}
9999

0 commit comments

Comments
 (0)