fix: routes controller on node name drift#1221
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1221 +/- ##
==========================================
+ Coverage 69.95% 70.34% +0.38%
==========================================
Files 24 24
Lines 2656 2674 +18
==========================================
+ Hits 1858 1881 +23
+ Misses 629 616 -13
- Partials 169 177 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0e99446 to
19d6cf7
Compare
19d6cf7 to
1382b4c
Compare
08a2e3f to
ea742f6
Compare
ea742f6 to
eb55116
Compare
| if node.Spec.ProviderID == "" { | ||
| return nil, nil, fmt.Errorf("%s: node %q not yet initialized", op, node.Name) | ||
| } |
There was a problem hiding this comment.
Is this a breaking change? IIRC it was previously possible to only use the route controller, without the node controller being active.
It feels like we talked about it sometime ago, but I forgot our resolution and there was no public doucmnetation in this PR.
There was a problem hiding this comment.
I think we can just make this a soft check and try to find the server via its ID (should be our happy path) and otherwise, fallback to the old behavior.
If a Kubernetes node got successfully initialized we have the Server ID stored in the node objets `providerID`. When renaming a Server, causing a drift between the node and Server name, we should still be able to identify the Server via its ID. This is currently not implemented in the routes' controller, where we rely purly on the Servers name. As the upstream library only provides us with the Kubernetes node name and not the full object, we have to first fetch it from the Kubernetes API. With the node object at hand we can identify and fetch the Server by its ID. Furthermore, we can use the Kubernetes node object to improve our handling of Kubernetes events. The event emitted on a CIDR mismatch is currently not associated with the affected node, because so far we did not have access to the nodes UUID.
eb55116 to
0796918
Compare
If a Kubernetes node got successfully initialized we have the Server ID stored in the node objets
providerID. When renaming a Server, causing a drift between the node and Server name, we should still be able to identify the Server via its ID. This is currently not implemented in the routes' controller, where we rely purly on the Servers name.As the upstream library only provides us with the Kubernetes node name and not the full object, we have to first fetch it from the Kubernetes API. With the node object at hand we can identify and fetch the Server by its ID. Furthermore, we can use the Kubernetes node object to improve our handling of Kubernetes events. The event emitted on a CIDR mismatch is currently not associated with the affected node, because so far we did not have access to the nodes UUID.