Minor simplification in load balancer supplier#1579
Minor simplification in load balancer supplier#1579ryanjbaxter merged 125 commits intospring-cloud:mainfrom wind57:minor-improvements
Conversation
Configure Renovate
| this.kubernetesNamespaceProvider = kubernetesNamespaceProvider; | ||
| } | ||
|
|
||
| private String getNamespace() { |
There was a problem hiding this comment.
this one is a little tricky, but not much.
we used to have it as:
return kubernetesNamespaceProvider != null ? kubernetesNamespaceProvider.getNamespace()
: kubernetesClientProperties.namespace();
let's asume kubernetesNamespaceProvider == null, which means kubernetesClientProperties.namespace() will be called. But there is no code that would provide kubernetesClientProperties, which means it was always null.
So if ever kubernetesNamespaceProvider == null, we would have got a NPE from kubernetesClientProperties.namespace(). So let's get rid of KubernetesClientProperties kubernetesClientProperties and only use KubernetesNamespaceProvider.
But even by doing that, we still keep the initial "intention", which I assume was that the KubernetesNamespaceProvider at the time of writing the code, did not have support for spring.cloud.kubernetes.client.namespace reading, that is why it was reading it from KubernetesClientProperties. Now this supports exists there, so I think the code works now as the initial intention.
There was a problem hiding this comment.
Yeah that is very weird, makes sense.
|
@ryanjbaxter ready to be looked at. thank you. |
No description provided.