-
Notifications
You must be signed in to change notification settings - Fork 1k
drop deprecations around informers + remove a few hacks we had where we were reading properties from Environment instead of properties #1211
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
Conversation
...main/java/org/springframework/cloud/kubernetes/client/KubernetesClientAutoConfiguration.java
Show resolved
Hide resolved
@@ -115,16 +115,6 @@ void inform() { | |||
if (enableReloadFiltering) { | |||
filter[0] = ConfigReloadProperties.RELOAD_LABEL_FILTER + "=true"; | |||
} | |||
|
|||
// We need to pass an APIClient to the SharedInformerFactory because if we use |
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.
I decided to remove this comment because the default constructor for SharedInformerFactory
is deprecated anyway
@@ -1,3 +1,4 @@ | |||
org.springframework.cloud.kubernetes.client.discovery.catalog.KubernetesCatalogWatchAutoConfiguration | |||
org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerDiscoveryClientAutoConfiguration | |||
org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerAutoConfiguration |
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.
add an auto-configuration
@@ -88,24 +85,4 @@ public KubernetesInformerReactiveDiscoveryClient kubernetesReactiveDiscoveryClie | |||
serviceLister, endpointsLister, serviceInformer, endpointsInformer, properties); | |||
} | |||
|
|||
@Bean | |||
@ConditionalOnMissingBean | |||
public CatalogSharedInformerFactory catalogSharedInformerFactory() { |
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.
both CatalogSharedInformerFactory
and SpringCloudKubernetesInformerFactoryProcessor
are removed, as we do not use them anymore. They were using deprecated functionality anyway
@ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES) | ||
@AutoConfigureBefore({ SimpleDiscoveryClientAutoConfiguration.class, CommonsClientAutoConfiguration.class }) | ||
@AutoConfigureAfter({ KubernetesClientAutoConfiguration.class, KubernetesDiscoveryPropertiesAutoConfiguration.class }) | ||
public class KubernetesInformerAutoConfiguration { |
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.
the "meat" of this PR is here. My main trigger towards making these changes was to drop deprecations we had around informers. The suggestion around deprecations was to create all you need manually, and don't rely on @KubernetesInformer
annotations, for example. And this is exactly what I do here: create all the needed beans by hand. It creates the same beans as we did before, basically.
@Documented | ||
@Inherited | ||
@Conditional(ConditionalOnBlockingOrReactiveEnabled.OnBlockingOrReactiveEnabled.class) | ||
public @interface ConditionalOnBlockingOrReactiveEnabled { |
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.
I need this because informers related beans are only needed when either blocking or reactive clients are active
return new Lister<>(endpointsSharedIndexInformer.getIndexer()); | ||
} | ||
|
||
private String namespace(KubernetesDiscoveryProperties discoveryProperties, |
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.
this logic was verbatim taken as it was before in the previous code. It lacks support for "selective namespaces", but I will add it in a different PR
@ryanjbaxter ready to be looked at. thank you. |
There are a number of breaking changes in here so we are going to have to hold off on merging this |
My thought process was like this:
I tend to agree with you a lot, cause you make sense, but I fail to see where the breaking change is in this PR :( please help me a bit. thank you! |
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.
Sorry I didn't realize that you removing some stuff that you recently created, but I still see some breaking changes I believe
No description provided.