fix(cli): validate shared gateway API and NATS hosts - #1485
Conversation
Signed-off-by: Mike Camp <mcamp@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe CLI now validates API and NATS Host overrides when service endpoints use a shared gateway hostname. Compute-plane registration passes the configured NATS host into reachability validation. ChangesShared Gateway Validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change adds validation for shared API and NATS gateway host overrides while preserving direct service-DNS behavior. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
🎉 This PR is included in version nvcf-cli-v1.16.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
TL;DR
Require API and NATS Host overrides when a self-managed control-plane profile routes those services through one shared gateway hostname.
Additional Details
The CLI already validates SIS and ReVal Host overrides for shared gateways. The API gateway URL and compute-reachable NATS URL could still omit their consumed Host overrides, allowing profile validation and registration dry runs to accept routes that the gateway cannot select.
This change validates those two remaining paths, passes the NATS Host through registration reachability checks, and preserves direct service-DNS endpoints that do not need Host overrides.
SIS/ReVal Host forwarding and HTTP probe response handling are provided by #1439. This PR does not duplicate those changes.
Before and After
flowchart LR subgraph OLD["Before this PR"] direction TB B1["API and NATS use a shared gateway hostname"] --> B2["API or NATS Host override is missing"] B2 --> B3["Profile validation can pass"] B3 --> B4["Registration proceeds to identity discovery and reachability"] end subgraph NEW["After this PR"] direction TB A1["Validate control-plane profile"] --> A2{"hosts.api is set"} A2 -->|No| A7["Reject before identity discovery or reachability"] A2 -->|Yes| A3{"NATS endpoint shares the gateway hostname"} A3 -->|Yes| A4{"hosts.nats is set"} A4 -->|No| A7 A3 -->|No, direct service DNS| A5["Profile is valid"] A4 -->|Yes| A5 A5 --> A6["Registration passes NATSHost to reachability validation"] endFor the Reviewer
Please focus on the shared-hostname comparison in the profile and reachability validators and the direct service-DNS compatibility tests.
Public Verification
Run from
src/clis/nvcf-cli:These cases verify that:
controlPlane.hosts.natsto reachability validation asNATSHost.For QA
Additional validation completed:
git diff --checkIssues
Closes #1484
Checklist
Summary by CodeRabbit
Bug Fixes
Tests