fix: allow single-label domains as network resources#670
Conversation
Remove the explicit dot requirement in ResourceSingleAddressInput. The backend accepts single-label domains (e.g. 'service') since v0.71.0 via netbirdio/netbird#5211, but the UI was blocking them with a hardcoded !value.includes('.') check.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Relaxes domain validation rules for the single-address input and updates the corresponding error message to reflect newly accepted formats.
Changes:
- Removes the “must contain a dot” domain requirement.
- Simplifies the invalid-domain condition to rely on
validator.isValidDomain()plus a trailing-dot check. - Updates the error message examples to include single-label names (e.g.,
service).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughIn ChangesDomain Validation Condition Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Remove the explicit dot requirement in ResourceSingleAddressInput.
The backend accepts single-label domains (e.g. 'service') since v0.71.0 via netbirdio/netbird#5211, but the UI was blocking them with a hardcoded !value.includes('.') check.
If you want to verify that the backend already accepted them:
use case(if needed): container setups where netbird & applications are in one network, allowing single-label domains allows one to talk to the application containers via their container name (internal DNS)
Issue ticket number and link
Documentation
Select exactly one:
not needed as the functionality was already there beforehand
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit