-
Notifications
You must be signed in to change notification settings - Fork 1k
drop some deprecations #1995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drop some deprecations #1995
Changes from all commits
a20a23c
1f17adc
f9e7c48
1e07b0b
c4ed64c
c4b3647
a0f9b2a
a556961
82983c3
31b10cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,20 +40,11 @@ | |
@AutoConfigureAfter(KubernetesCommonsAutoConfiguration.class) | ||
public class KubernetesClientAutoConfiguration { | ||
|
||
/** | ||
* this bean will be based on | ||
* {@link org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties} | ||
* in the next major release. | ||
*/ | ||
@Deprecated(forRemoval = true) | ||
@Bean | ||
@ConditionalOnMissingBean | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we were getting something from the
and now we do it from |
||
public ApiClient apiClient(Environment environment) { | ||
public ApiClient apiClient(KubernetesClientProperties clientProperties) { | ||
ApiClient apiClient = kubernetesApiClient(); | ||
// it's too early to inject KubernetesClientProperties here, all its properties | ||
// are missing. For the time being work-around with reading from the environment. | ||
apiClient.setUserAgent(environment.getProperty("spring.cloud.kubernetes.client.user-agent", | ||
KubernetesClientProperties.DEFAULT_USER_AGENT)); | ||
apiClient.setUserAgent(clientProperties.userAgent()); | ||
return apiClient; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -499,8 +499,7 @@ static class LocalTestConfig { | |
@Bean | ||
KubernetesClientProperties kubernetesClientProperties() { | ||
return new KubernetesClientProperties(null, null, null, "default", null, null, null, null, null, null, null, | ||
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, | ||
null); | ||
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one less argument here, |
||
} | ||
|
||
@Bean | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,6 @@ | |
import jakarta.annotation.PostConstruct; | ||
import org.apache.commons.logging.LogFactory; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.cloud.client.ServiceInstance; | ||
import org.springframework.cloud.client.discovery.DiscoveryClient; | ||
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties; | ||
|
@@ -82,46 +81,17 @@ public class KubernetesInformerDiscoveryClient implements DiscoveryClient { | |
|
||
private final ServicePortSecureResolver servicePortSecureResolver; | ||
|
||
// visible only for testing and | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this comment is first resolved, related to |
||
// must be constructor injected in a future release | ||
@Autowired | ||
CoreV1Api coreV1Api; | ||
|
||
@Deprecated(forRemoval = true) | ||
public KubernetesInformerDiscoveryClient(String namespace, SharedInformerFactory sharedInformerFactory, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this constructor is removed, and we are left with a single one. Let me try to simplify this. We had two constructors:
and
again, this simplifies it so that its easier to understand the change. Now, we only have a single constructor, that accepts a |
||
Lister<V1Service> serviceLister, Lister<V1Endpoints> endpointsLister, | ||
SharedInformer<V1Service> serviceInformer, SharedInformer<V1Endpoints> endpointsInformer, | ||
KubernetesDiscoveryProperties properties) { | ||
this.sharedInformerFactories = List.of(sharedInformerFactory); | ||
this.serviceListers = List.of(serviceLister); | ||
this.endpointsListers = List.of(endpointsLister); | ||
this.informersReadyFunc = () -> serviceInformer.hasSynced() && endpointsInformer.hasSynced(); | ||
this.properties = properties; | ||
filter = filter(properties); | ||
servicePortSecureResolver = new ServicePortSecureResolver(properties); | ||
} | ||
|
||
public KubernetesInformerDiscoveryClient(SharedInformerFactory sharedInformerFactory, | ||
Lister<V1Service> serviceLister, Lister<V1Endpoints> endpointsLister, | ||
SharedInformer<V1Service> serviceInformer, SharedInformer<V1Endpoints> endpointsInformer, | ||
KubernetesDiscoveryProperties properties) { | ||
this.sharedInformerFactories = List.of(sharedInformerFactory); | ||
this.serviceListers = List.of(serviceLister); | ||
this.endpointsListers = List.of(endpointsLister); | ||
this.informersReadyFunc = () -> serviceInformer.hasSynced() && endpointsInformer.hasSynced(); | ||
this.properties = properties; | ||
filter = filter(properties); | ||
servicePortSecureResolver = new ServicePortSecureResolver(properties); | ||
} | ||
private final CoreV1Api coreV1Api; | ||
|
||
public KubernetesInformerDiscoveryClient(List<SharedInformerFactory> sharedInformerFactories, | ||
List<Lister<V1Service>> serviceListers, List<Lister<V1Endpoints>> endpointsListers, | ||
List<SharedInformer<V1Service>> serviceInformers, List<SharedInformer<V1Endpoints>> endpointsInformers, | ||
KubernetesDiscoveryProperties properties) { | ||
KubernetesDiscoveryProperties properties, CoreV1Api coreV1Api) { | ||
this.sharedInformerFactories = sharedInformerFactories; | ||
|
||
this.serviceListers = serviceListers; | ||
this.endpointsListers = endpointsListers; | ||
this.coreV1Api = coreV1Api; | ||
this.informersReadyFunc = () -> { | ||
boolean serviceInformersReady = serviceInformers.isEmpty() || serviceInformers.stream() | ||
.map(SharedInformer::hasSynced) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only need this for github, so add the profile