Skip to content

Commit e64e9b6

Browse files
committed
drop some deprecations
Signed-off-by: wind57 <[email protected]>
1 parent 020222d commit e64e9b6

File tree

21 files changed

+16
-246
lines changed

21 files changed

+16
-246
lines changed

.github/workflows/composites/pre-test-actions/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ runs:
2424
- name: build project
2525
shell: bash
2626
run: |
27-
./mvnw clean install -Dspring-boot.build-image.skip=true -DskipITs -DskipTests -T1C -U -B -q
27+
./mvnw clean install -P 'run-on-github-actions' -Dspring-boot.build-image.skip=true -DskipITs -DskipTests -T1C -U -B -q
2828
2929
- name: build controllers project
3030
uses: ./.github/workflows/composites/build-controllers-project

spring-cloud-kubernetes-client-autoconfig/src/main/java/org/springframework/cloud/kubernetes/client/KubernetesClientAutoConfiguration.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,11 @@
4040
@AutoConfigureAfter(KubernetesCommonsAutoConfiguration.class)
4141
public class KubernetesClientAutoConfiguration {
4242

43-
/**
44-
* this bean will be based on
45-
* {@link org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties}
46-
* in the next major release.
47-
*/
48-
@Deprecated(forRemoval = true)
4943
@Bean
5044
@ConditionalOnMissingBean
51-
public ApiClient apiClient(Environment environment) {
45+
public ApiClient apiClient(KubernetesClientProperties clientProperties) {
5246
ApiClient apiClient = kubernetesApiClient();
53-
// it's too early to inject KubernetesClientProperties here, all its properties
54-
// are missing. For the time being work-around with reading from the environment.
55-
apiClient.setUserAgent(environment.getProperty("spring.cloud.kubernetes.client.user-agent",
56-
KubernetesClientProperties.DEFAULT_USER_AGENT));
47+
apiClient.setUserAgent(clientProperties.userAgent());
5748
return apiClient;
5849
}
5950

spring-cloud-kubernetes-client-autoconfig/src/main/java/org/springframework/cloud/kubernetes/client/KubernetesClientPodUtils.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,6 @@ public class KubernetesClientPodUtils implements PodUtils<V1Pod> {
6060

6161
private final boolean failFast;
6262

63-
@Deprecated(forRemoval = true)
64-
public KubernetesClientPodUtils(CoreV1Api client, String namespace) {
65-
if (client == null) {
66-
throw new IllegalArgumentException("Must provide an instance of KubernetesClient");
67-
}
68-
69-
this.client = client;
70-
this.hostName = EnvReader.getEnv(HOSTNAME);
71-
this.serviceHost = EnvReader.getEnv(KUBERNETES_SERVICE_HOST);
72-
this.current = LazilyInstantiate.using(this::internalGetPod);
73-
this.namespace = namespace;
74-
this.failFast = false;
75-
}
76-
7763
// mainly needed for the health and info contributors, so that they report DOWN
7864
// correctly
7965
public KubernetesClientPodUtils(CoreV1Api client, String namespace, boolean failFast) {

spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientSecretsPropertySource.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
*/
3030
public class KubernetesClientSecretsPropertySource extends SecretsPropertySource {
3131

32-
@Deprecated(forRemoval = true)
33-
public KubernetesClientSecretsPropertySource(SourceData sourceData) {
34-
super(sourceData);
35-
}
36-
3732
private static final EnumMap<NormalizedSourceType, KubernetesClientContextToSourceData> STRATEGIES = new EnumMap<>(
3833
NormalizedSourceType.class);
3934

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

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -82,37 +82,7 @@ public class KubernetesInformerDiscoveryClient implements DiscoveryClient {
8282

8383
private final ServicePortSecureResolver servicePortSecureResolver;
8484

85-
// visible only for testing and
86-
// must be constructor injected in a future release
87-
@Autowired
88-
CoreV1Api coreV1Api;
89-
90-
@Deprecated(forRemoval = true)
91-
public KubernetesInformerDiscoveryClient(String namespace, SharedInformerFactory sharedInformerFactory,
92-
Lister<V1Service> serviceLister, Lister<V1Endpoints> endpointsLister,
93-
SharedInformer<V1Service> serviceInformer, SharedInformer<V1Endpoints> endpointsInformer,
94-
KubernetesDiscoveryProperties properties) {
95-
this.sharedInformerFactories = List.of(sharedInformerFactory);
96-
this.serviceListers = List.of(serviceLister);
97-
this.endpointsListers = List.of(endpointsLister);
98-
this.informersReadyFunc = () -> serviceInformer.hasSynced() && endpointsInformer.hasSynced();
99-
this.properties = properties;
100-
filter = filter(properties);
101-
servicePortSecureResolver = new ServicePortSecureResolver(properties);
102-
}
103-
104-
public KubernetesInformerDiscoveryClient(SharedInformerFactory sharedInformerFactory,
105-
Lister<V1Service> serviceLister, Lister<V1Endpoints> endpointsLister,
106-
SharedInformer<V1Service> serviceInformer, SharedInformer<V1Endpoints> endpointsInformer,
107-
KubernetesDiscoveryProperties properties) {
108-
this.sharedInformerFactories = List.of(sharedInformerFactory);
109-
this.serviceListers = List.of(serviceLister);
110-
this.endpointsListers = List.of(endpointsLister);
111-
this.informersReadyFunc = () -> serviceInformer.hasSynced() && endpointsInformer.hasSynced();
112-
this.properties = properties;
113-
filter = filter(properties);
114-
servicePortSecureResolver = new ServicePortSecureResolver(properties);
115-
}
85+
private final CoreV1Api coreV1Api;
11686

11787
public KubernetesInformerDiscoveryClient(List<SharedInformerFactory> sharedInformerFactories,
11888
List<Lister<V1Service>> serviceListers, List<Lister<V1Endpoints>> endpointsListers,

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.springframework.cloud.client.CommonsClientAutoConfiguration;
3232
import org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration;
3333
import org.springframework.cloud.kubernetes.client.KubernetesClientAutoConfiguration;
34-
import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider;
3534
import org.springframework.cloud.kubernetes.commons.PodUtils;
3635
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnSpringCloudKubernetesBlockingDiscovery;
3736
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnSpringCloudKubernetesBlockingDiscoveryHealthInitializer;
@@ -58,16 +57,6 @@ public class KubernetesInformerDiscoveryClientAutoConfiguration {
5857
private static final LogAccessor LOG = new LogAccessor(
5958
LogFactory.getLog(KubernetesInformerDiscoveryClientAutoConfiguration.class));
6059

61-
@Deprecated(forRemoval = true)
62-
public KubernetesInformerDiscoveryClient kubernetesInformerDiscoveryClient(
63-
KubernetesNamespaceProvider kubernetesNamespaceProvider, SharedInformerFactory sharedInformerFactory,
64-
Lister<V1Service> serviceLister, Lister<V1Endpoints> endpointsLister,
65-
SharedInformer<V1Service> serviceInformer, SharedInformer<V1Endpoints> endpointsInformer,
66-
KubernetesDiscoveryProperties properties) {
67-
return new KubernetesInformerDiscoveryClient(kubernetesNamespaceProvider.getNamespace(), sharedInformerFactory,
68-
serviceLister, endpointsLister, serviceInformer, endpointsInformer, properties);
69-
}
70-
7160
/**
7261
* Creation of this bean triggers publishing an InstanceRegisteredEvent. In turn,
7362
* there is the CommonsClientAutoConfiguration::DiscoveryClientHealthIndicator, that
@@ -89,8 +78,8 @@ KubernetesInformerDiscoveryClient kubernetesClientInformerDiscoveryClient(
8978
SharedInformerFactory sharedInformerFactory, Lister<V1Service> serviceLister,
9079
Lister<V1Endpoints> endpointsLister, SharedInformer<V1Service> serviceInformer,
9180
SharedInformer<V1Endpoints> endpointsInformer, KubernetesDiscoveryProperties properties) {
92-
return new KubernetesInformerDiscoveryClient(sharedInformerFactory, serviceLister, endpointsLister,
93-
serviceInformer, endpointsInformer, properties);
81+
return new KubernetesInformerDiscoveryClient(List.of(sharedInformerFactory), List.of(serviceLister),
82+
List.of(endpointsLister), List.of(serviceInformer), List.of(endpointsInformer), properties);
9483
}
9584

9685
@Bean

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,12 @@
1818

1919
import java.util.Objects;
2020

21-
import io.kubernetes.client.informer.SharedInformer;
22-
import io.kubernetes.client.informer.SharedInformerFactory;
23-
import io.kubernetes.client.informer.cache.Lister;
24-
import io.kubernetes.client.openapi.models.V1Endpoints;
25-
import io.kubernetes.client.openapi.models.V1Service;
2621
import reactor.core.publisher.Flux;
2722
import reactor.core.scheduler.Schedulers;
2823

2924
import org.springframework.cloud.client.ServiceInstance;
3025
import org.springframework.cloud.client.discovery.ReactiveDiscoveryClient;
3126
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerDiscoveryClient;
32-
import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider;
33-
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties;
3427

3528
/**
3629
* @author Ryan Baxter
@@ -39,16 +32,6 @@ public class KubernetesInformerReactiveDiscoveryClient implements ReactiveDiscov
3932

4033
private final KubernetesInformerDiscoveryClient kubernetesDiscoveryClient;
4134

42-
@Deprecated(forRemoval = true)
43-
public KubernetesInformerReactiveDiscoveryClient(KubernetesNamespaceProvider kubernetesNamespaceProvider,
44-
SharedInformerFactory sharedInformerFactory, Lister<V1Service> serviceLister,
45-
Lister<V1Endpoints> endpointsLister, SharedInformer<V1Service> serviceInformer,
46-
SharedInformer<V1Endpoints> endpointsInformer, KubernetesDiscoveryProperties properties) {
47-
this.kubernetesDiscoveryClient = new KubernetesInformerDiscoveryClient(
48-
kubernetesNamespaceProvider.getNamespace(), sharedInformerFactory, serviceLister, endpointsLister,
49-
serviceInformer, endpointsInformer, properties);
50-
}
51-
5235
// this is either kubernetesClientInformerDiscoveryClient
5336
// or selectiveNamespacesKubernetesClientInformerDiscoveryClient
5437
KubernetesInformerReactiveDiscoveryClient(KubernetesInformerDiscoveryClient kubernetesDiscoveryClient) {

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import org.springframework.cloud.kubernetes.client.discovery.KubernetesClientInformerAutoConfiguration;
4141
import org.springframework.cloud.kubernetes.client.discovery.KubernetesClientInformerSelectiveNamespacesAutoConfiguration;
4242
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerDiscoveryClient;
43-
import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider;
4443
import org.springframework.cloud.kubernetes.commons.PodUtils;
4544
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnSpringCloudKubernetesReactiveDiscovery;
4645
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnSpringCloudKubernetesReactiveDiscoveryHealthInitializer;
@@ -71,29 +70,6 @@ public class KubernetesInformerReactiveDiscoveryClientAutoConfiguration {
7170
private static final LogAccessor LOG = new LogAccessor(
7271
LogFactory.getLog(KubernetesInformerReactiveDiscoveryClientAutoConfiguration.class));
7372

74-
@Deprecated(forRemoval = true)
75-
public ReactiveDiscoveryClientHealthIndicator kubernetesReactiveDiscoveryClientHealthIndicator(
76-
KubernetesInformerReactiveDiscoveryClient client, DiscoveryClientHealthIndicatorProperties properties,
77-
KubernetesClientPodUtils podUtils) {
78-
ReactiveDiscoveryClientHealthIndicator healthIndicator = new ReactiveDiscoveryClientHealthIndicator(client,
79-
properties);
80-
InstanceRegisteredEvent<RegisteredEventSource> event = new InstanceRegisteredEvent<>(
81-
new RegisteredEventSource("kubernetes", podUtils.isInsideKubernetes(), podUtils.currentPod().get()),
82-
null);
83-
healthIndicator.onApplicationEvent(event);
84-
return healthIndicator;
85-
}
86-
87-
@Deprecated(forRemoval = true)
88-
public KubernetesInformerReactiveDiscoveryClient kubernetesReactiveDiscoveryClient(
89-
KubernetesNamespaceProvider kubernetesNamespaceProvider, SharedInformerFactory sharedInformerFactory,
90-
Lister<V1Service> serviceLister, Lister<V1Endpoints> endpointsLister,
91-
SharedInformer<V1Service> serviceInformer, SharedInformer<V1Endpoints> endpointsInformer,
92-
KubernetesDiscoveryProperties properties) {
93-
return new KubernetesInformerReactiveDiscoveryClient(kubernetesNamespaceProvider, sharedInformerFactory,
94-
serviceLister, endpointsLister, serviceInformer, endpointsInformer, properties);
95-
}
96-
9773
/**
9874
* Post an event so that health indicator is initialized.
9975
*/

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/KubernetesClientProperties.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public record KubernetesClientProperties(Boolean trustCerts, String masterUrl, S
3333
String caCertFile, String caCertData, String clientCertFile, String clientCertData, String clientKeyFile,
3434
String clientKeyData, String clientKeyAlgo, String clientKeyPassphrase, String username, String password,
3535
Duration watchReconnectInterval, Duration watchReconnectLimit, Duration connectionTimeout,
36-
Duration requestTimeout, @Deprecated(forRemoval = true) Duration rollingTimeout, Duration loggingInterval,
37-
String httpProxy, String httpsProxy, String proxyUsername, String proxyPassword, String oauthToken,
38-
String[] noProxy, @DefaultValue(SERVICE_ACCOUNT_NAMESPACE_PATH) String serviceAccountNamespacePath,
36+
Duration requestTimeout, Duration loggingInterval, String httpProxy, String httpsProxy, String proxyUsername,
37+
String proxyPassword, String oauthToken, String[] noProxy,
38+
@DefaultValue(SERVICE_ACCOUNT_NAMESPACE_PATH) String serviceAccountNamespacePath,
3939
@DefaultValue(DEFAULT_USER_AGENT) String userAgent) {
4040

4141
/**
@@ -61,9 +61,9 @@ public KubernetesClientProperties withNamespace(String namespace) {
6161
this.caCertFile(), this.caCertData(), this.clientCertFile(), this.clientCertData(),
6262
this.clientKeyFile(), this.clientKeyData(), this.clientKeyAlgo(), this.clientKeyPassphrase(),
6363
this.username(), this.password(), this.watchReconnectInterval(), this.watchReconnectLimit(),
64-
this.connectionTimeout(), this.requestTimeout(), this.rollingTimeout(), this.loggingInterval(),
65-
this.httpProxy(), this.httpsProxy(), this.proxyUsername(), this.proxyPassword(), this.oauthToken(),
66-
this.noProxy(), this.serviceAccountNamespacePath(), this.userAgent());
64+
this.connectionTimeout(), this.requestTimeout(), this.loggingInterval(), this.httpProxy(),
65+
this.httpsProxy(), this.proxyUsername(), this.proxyPassword(), this.oauthToken(), this.noProxy(),
66+
this.serviceAccountNamespacePath(), this.userAgent());
6767
}
6868

6969
}

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigDataRetryableConfigMapPropertySourceLocator.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,6 @@ public class ConfigDataRetryableConfigMapPropertySourceLocator extends ConfigMap
3535

3636
private ConfigMapPropertySourceLocator configMapPropertySourceLocator;
3737

38-
/**
39-
* This constructor is deprecated, and we do not use it anymore internally. It will be
40-
* removed in the next major release.
41-
*/
42-
@Deprecated(forRemoval = true)
43-
public ConfigDataRetryableConfigMapPropertySourceLocator(
44-
ConfigMapPropertySourceLocator configMapPropertySourceLocator, ConfigMapConfigProperties properties) {
45-
super(properties);
46-
this.configMapPropertySourceLocator = configMapPropertySourceLocator;
47-
this.retryTemplate = RetryTemplate.builder()
48-
.maxAttempts(properties.retry().maxAttempts())
49-
.exponentialBackoff(properties.retry().initialInterval(), properties.retry().multiplier(),
50-
properties.retry().maxInterval())
51-
.build();
52-
}
53-
5438
public ConfigDataRetryableConfigMapPropertySourceLocator(
5539
ConfigMapPropertySourceLocator configMapPropertySourceLocator, ConfigMapConfigProperties properties,
5640
ConfigMapCache cache) {

0 commit comments

Comments
 (0)