Skip to content

Commit a378ac1

Browse files
committed
first run on github pipeline
Signed-off-by: wind57 <[email protected]>
1 parent 32da6d7 commit a378ac1

File tree

16 files changed

+95
-85
lines changed

16 files changed

+95
-85
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
* @author Ryan Baxter
6363
* @author Tim Yysewyn
6464
*/
65-
final class KubernetesClientInformerDiscoveryClient implements DiscoveryClient {
65+
class KubernetesClientInformerDiscoveryClient implements DiscoveryClient {
6666

6767
private static final LogAccessor LOG = new LogAccessor(
6868
LogFactory.getLog(KubernetesClientInformerDiscoveryClient.class));

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@
2727
/**
2828
* @author Ryan Baxter
2929
*/
30-
class KubernetesClientInformerReactiveDiscoveryClient implements ReactiveDiscoveryClient {
30+
public final class KubernetesClientInformerReactiveDiscoveryClient implements ReactiveDiscoveryClient {
3131

3232
private final KubernetesClientInformerDiscoveryClient kubernetesDiscoveryClient;
3333

34-
KubernetesClientInformerReactiveDiscoveryClient(KubernetesClientInformerDiscoveryClient kubernetesDiscoveryClient) {
34+
public KubernetesClientInformerReactiveDiscoveryClient(
35+
KubernetesClientInformerDiscoveryClient kubernetesDiscoveryClient) {
3536
this.kubernetesDiscoveryClient = kubernetesDiscoveryClient;
3637
}
3738

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configuration-watcher/src/main/java/org/springframework/cloud/kubernetes/configuration/watcher/HttpRefreshTrigger.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import reactor.core.publisher.Mono;
2525

2626
import org.springframework.cloud.client.ServiceInstance;
27-
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerReactiveDiscoveryClient;
27+
import org.springframework.cloud.kubernetes.client.discovery.KubernetesClientInformerReactiveDiscoveryClient;
2828
import org.springframework.core.log.LogAccessor;
2929
import org.springframework.http.ResponseEntity;
3030
import org.springframework.util.StringUtils;
@@ -40,13 +40,13 @@ final class HttpRefreshTrigger implements RefreshTrigger {
4040

4141
private static final LogAccessor LOG = new LogAccessor(LogFactory.getLog(HttpRefreshTrigger.class));
4242

43-
private final KubernetesInformerReactiveDiscoveryClient kubernetesReactiveDiscoveryClient;
43+
private final KubernetesClientInformerReactiveDiscoveryClient kubernetesReactiveDiscoveryClient;
4444

4545
private final ConfigurationWatcherConfigurationProperties k8SConfigurationProperties;
4646

4747
private final WebClient webClient;
4848

49-
HttpRefreshTrigger(KubernetesInformerReactiveDiscoveryClient kubernetesReactiveDiscoveryClient,
49+
HttpRefreshTrigger(KubernetesClientInformerReactiveDiscoveryClient kubernetesReactiveDiscoveryClient,
5050
ConfigurationWatcherConfigurationProperties k8SConfigurationProperties, WebClient webClient) {
5151
this.kubernetesReactiveDiscoveryClient = kubernetesReactiveDiscoveryClient;
5252
this.k8SConfigurationProperties = k8SConfigurationProperties;

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configuration-watcher/src/main/java/org/springframework/cloud/kubernetes/configuration/watcher/RefreshTriggerAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2121
import org.springframework.boot.cloud.CloudPlatform;
2222
import org.springframework.cloud.bus.BusProperties;
23-
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerReactiveDiscoveryClient;
23+
import org.springframework.cloud.kubernetes.client.discovery.KubernetesClientInformerReactiveDiscoveryClient;
2424
import org.springframework.context.ApplicationEventPublisher;
2525
import org.springframework.context.annotation.Bean;
2626
import org.springframework.context.annotation.Configuration;
@@ -49,7 +49,7 @@ BusRefreshTrigger busRefreshTrigger(ApplicationEventPublisher applicationEventPu
4949
@Bean
5050
@ConditionalOnMissingBean
5151
@Profile({ NOT_AMQP_NOT_KAFKA })
52-
HttpRefreshTrigger httpRefreshTrigger(KubernetesInformerReactiveDiscoveryClient client,
52+
HttpRefreshTrigger httpRefreshTrigger(KubernetesClientInformerReactiveDiscoveryClient client,
5353
ConfigurationWatcherConfigurationProperties properties, WebClient webClient) {
5454
return new HttpRefreshTrigger(client, properties, webClient);
5555
}

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configuration-watcher/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/HttpBasedConfigMapWatchChangeDetectorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import org.springframework.cloud.client.ServiceInstance;
4747
import org.springframework.cloud.kubernetes.client.KubernetesClientUtils;
4848
import org.springframework.cloud.kubernetes.client.config.KubernetesClientConfigMapPropertySourceLocator;
49-
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerReactiveDiscoveryClient;
49+
import org.springframework.cloud.kubernetes.client.discovery.KubernetesClientInformerReactiveDiscoveryClient;
5050
import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider;
5151
import org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadProperties;
5252
import org.springframework.cloud.kubernetes.commons.config.reload.ConfigurationUpdateStrategy;
@@ -83,7 +83,7 @@ class HttpBasedConfigMapWatchChangeDetectorTests {
8383
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
8484

8585
@Mock
86-
private KubernetesInformerReactiveDiscoveryClient reactiveDiscoveryClient;
86+
private KubernetesClientInformerReactiveDiscoveryClient reactiveDiscoveryClient;
8787

8888
private MockEnvironment mockEnvironment;
8989

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configuration-watcher/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/HttpBasedSecretsWatchChangeDetectorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import org.springframework.cloud.client.ServiceInstance;
4646
import org.springframework.cloud.kubernetes.client.KubernetesClientUtils;
4747
import org.springframework.cloud.kubernetes.client.config.KubernetesClientSecretsPropertySourceLocator;
48-
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerReactiveDiscoveryClient;
48+
import org.springframework.cloud.kubernetes.client.discovery.KubernetesClientInformerReactiveDiscoveryClient;
4949
import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider;
5050
import org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadProperties;
5151
import org.springframework.cloud.kubernetes.commons.config.reload.ConfigurationUpdateStrategy;
@@ -86,7 +86,7 @@ class HttpBasedSecretsWatchChangeDetectorTests {
8686
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
8787

8888
@Mock
89-
private KubernetesInformerReactiveDiscoveryClient reactiveDiscoveryClient;
89+
private KubernetesClientInformerReactiveDiscoveryClient reactiveDiscoveryClient;
9090

9191
private MockEnvironment mockEnvironment;
9292

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configuration-watcher/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/RefreshTriggerAutoConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.springframework.boot.test.context.TestConfiguration;
2323
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2424
import org.springframework.cloud.bus.BusProperties;
25-
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerReactiveDiscoveryClient;
25+
import org.springframework.cloud.kubernetes.client.discovery.KubernetesClientInformerReactiveDiscoveryClient;
2626
import org.springframework.context.annotation.Bean;
2727
import org.springframework.context.annotation.Primary;
2828
import org.springframework.web.reactive.function.client.WebClient;
@@ -118,8 +118,8 @@ BusProperties busProperties() {
118118

119119
@Bean
120120
@Primary
121-
KubernetesInformerReactiveDiscoveryClient client() {
122-
return Mockito.mock(KubernetesInformerReactiveDiscoveryClient.class);
121+
KubernetesClientInformerReactiveDiscoveryClient client() {
122+
return Mockito.mock(KubernetesClientInformerReactiveDiscoveryClient.class);
123123
}
124124

125125
@Bean

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-discoveryserver/src/main/java/org/springframework/cloud/kubernetes/discoveryserver/DiscoveryServerController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import reactor.core.publisher.Mono;
2121

2222
import org.springframework.cloud.client.ServiceInstance;
23-
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerReactiveDiscoveryClient;
23+
import org.springframework.cloud.kubernetes.client.discovery.KubernetesClientInformerReactiveDiscoveryClient;
2424
import org.springframework.cloud.kubernetes.commons.discovery.DefaultKubernetesServiceInstance;
2525
import org.springframework.cloud.kubernetes.commons.discovery.Service;
2626
import org.springframework.web.bind.annotation.GetMapping;
@@ -33,9 +33,9 @@
3333
@RestController
3434
public class DiscoveryServerController {
3535

36-
private final KubernetesInformerReactiveDiscoveryClient reactiveDiscoveryClient;
36+
private final KubernetesClientInformerReactiveDiscoveryClient reactiveDiscoveryClient;
3737

38-
public DiscoveryServerController(KubernetesInformerReactiveDiscoveryClient reactiveDiscoveryClient) {
38+
public DiscoveryServerController(KubernetesClientInformerReactiveDiscoveryClient reactiveDiscoveryClient) {
3939
this.reactiveDiscoveryClient = reactiveDiscoveryClient;
4040
}
4141

spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-discoveryserver/src/test/java/org/springframework/cloud/kubernetes/client/discovery/HandleToReactiveDiscoveryClient.java

Lines changed: 0 additions & 32 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2013-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.cloud.kubernetes.client.discovery;
18+
19+
import java.util.List;
20+
import java.util.function.Predicate;
21+
22+
import io.kubernetes.client.informer.SharedInformer;
23+
import io.kubernetes.client.informer.SharedInformerFactory;
24+
import io.kubernetes.client.informer.cache.Lister;
25+
import io.kubernetes.client.openapi.apis.CoreV1Api;
26+
import io.kubernetes.client.openapi.models.V1Endpoints;
27+
import io.kubernetes.client.openapi.models.V1Service;
28+
29+
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties;
30+
31+
/**
32+
* @author wind57
33+
*/
34+
public class VisibleKubernetesClientInformerDiscoveryClient extends KubernetesClientInformerDiscoveryClient {
35+
36+
public VisibleKubernetesClientInformerDiscoveryClient(List<SharedInformerFactory> sharedInformerFactories,
37+
List<Lister<V1Service>> serviceListers, List<Lister<V1Endpoints>> endpointsListers,
38+
List<SharedInformer<V1Service>> serviceInformers, List<SharedInformer<V1Endpoints>> endpointsInformers,
39+
KubernetesDiscoveryProperties properties, CoreV1Api coreV1Api, Predicate<V1Service> predicate) {
40+
super(sharedInformerFactories, serviceListers, endpointsListers, serviceInformers, endpointsInformers,
41+
properties, coreV1Api, predicate);
42+
}
43+
44+
}

0 commit comments

Comments
 (0)