Conversation
Greptile SummaryThis PR fixes the DRA provider's node-matching logic to read the cloud instance ID from the
Confidence Score: 5/5Safe to merge — the fix is narrow, well-tested for the happy path, and consistent with how every other provider in the codebase already resolves instance IDs. The change replaces a single hardcoded assumption (node.Name == instance ID) with the annotation-based lookup already used by every other provider. The new test confirms the corrected behavior with a fake clientset. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[GenerateTopologyConfig called] --> B[List Kubernetes nodes]
B --> C{Node has DomainLabel?}
C -- No --> D[Skip node]
C -- Yes --> E{Node has KeyNodeRegion annotation?}
E -- No / unmatched region --> D
E -- Yes --> F{Node has KeyNodeInstance annotation?}
F -- Missing or empty --> G[klog.Warningf + skip node]
F -- Present --> H{instanceID in instances map?}
H -- No --> D
H -- Yes --> I[domainMap.AddHost clusterID, instanceID, host]
I --> J{Any hosts added?}
J -- No --> K[Return 502 error]
J -- Yes --> L[Return topology.Graph]
Reviews (6): Last reviewed commit: "fix(provider/dra): match nodes by annota..." | Re-trigger Greptile |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #405 +/- ##
==========================================
+ Coverage 72.15% 73.59% +1.44%
==========================================
Files 89 94 +5
Lines 5689 6272 +583
==========================================
+ Hits 4105 4616 +511
- Misses 1382 1410 +28
- Partials 202 246 +44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
36ef80a to
23561d5
Compare
|
🌿 Preview your docs: https://nvidia-preview-pull-request-405.docs.buildwithfern.com/topograph |
ArangoGutierrez
left a comment
There was a problem hiding this comment.
Correct fix — DRA was the last provider still joining on node.Name, and the new test genuinely discriminates it (node name differs from the instance ID). One optional diagnostic suggestion below.
- A clique-labeled node missing this annotation is now skipped silently. The sibling join sites warn on the same skip — internal/k8s/utils.go and engines/slinky/engine.go both do
klog.Warningf("missing %q annotation in node %s", ...), and #379 added exactly this diagnostic to the structurally identical clique+annotation loop in Slinky. A klog.Warningf before the continue would restore that signal; otherwise a not-yet-annotated node disappears with no trace, since the BadGateway error only fires when every node is skipped. (pkg/providers/dra/provider.go:113)
Signed-off-by: Dmitry Shmulevich <dshmulevich@nvidia.com>
No description provided.