ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.28k stars 1.63k forks source link

[#1527 #1529] Breaking change to the class renaming of `Kube` service discovery provider #1954

Closed ZisisTsatsas closed 6 months ago

ZisisTsatsas commented 6 months ago

The Type field for the Kubernetes example is outdated in the docs


Update by Maintainer on Feb 10, 2024 👉

Fixes #1527 #1529

raman-m commented 6 months ago

@ZisisTsatsas Hi Zisis! Thanks for the issue reporting!

You are right, the docs were not updated. But it was my mistake when I renamed the class a half of the year ago... Seems we need to rename the class back to Kube. So, finally there should be old two types: Kube and PollKube... and docs can be unchanged. Sorry, for this breaking change!

@ggnaegi Do you agree using old types Kube and PollKube? But I know you don't use these providers...

raman-m commented 6 months ago

@ZisisTsatsas Could you help me with resolving this breaking change plz? Or, I will work on the issue this weekend... Sorry, I'm very busy today and will be offline right away.

raman-m commented 6 months ago

The root cause of the problem: https://github.com/ThreeMammals/Ocelot/blob/c9510b1c6aed7902e681978f5104bd2780f2f5dd/src/Ocelot/ServiceDiscovery/ServiceDiscoveryProviderFactory.cs#L59

of these block of code: https://github.com/ThreeMammals/Ocelot/blob/c9510b1c6aed7902e681978f5104bd2780f2f5dd/src/Ocelot/ServiceDiscovery/ServiceDiscoveryProviderFactory.cs#L55-L63

where _delegates is ServiceDiscoveryFinderDelegate and it is added into the DI: https://github.com/ThreeMammals/Ocelot/blob/c9510b1c6aed7902e681978f5104bd2780f2f5dd/src/Ocelot.Provider.Kubernetes/OcelotBuilderExtensions.cs#L11

Finally, in this line of code we have https://github.com/ThreeMammals/Ocelot/blob/c9510b1c6aed7902e681978f5104bd2780f2f5dd/src/Ocelot/ServiceDiscovery/ServiceDiscoveryProviderFactory.cs#L59if ("KubernetesServiceDiscoveryProvider".ToLower() == "Kube".ToLower()) which is false always! This is the bug and the breaking change ❗

raman-m commented 6 months ago

Hi @ZisisTsatsas ! I found a couple of issues related to Kube provider and attached them to your PR 👉

So, these bugs will be closed officially by your PR 😉

@ggnaegi FYI

raman-m commented 6 months ago

Development completed ✔️

@RaynaldM @ggnaegi Please review!

raman-m commented 6 months ago

Funny fact is that the breaking change was introduced in 15.0.0 release by Tom in the commit https://github.com/ThreeMammals/Ocelot/commit/6e5471a714dddb0a3a40fbb97eac2810cee1c78d 🤯 I thought that I was the author of the bug in 19.x or 20.0 releases 🤣 but No: Tom did the thing. 😄

raman-m commented 6 months ago

@ZisisTsatsas Will you use our updated & fixed Kubernetes provider and Ocelot after the release? 😉

ZisisTsatsas commented 6 months ago

@ZisisTsatsas Will you use our updated & fixed Kubernetes provider and Ocelot after the release? 😉

I will be using it! Thanks for the quick udpate