-
Notifications
You must be signed in to change notification settings - Fork 395
T8016: Add --numeric-only argument to port-range validator #4863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: current
Are you sure you want to change the base?
Conversation
|
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a --only-numeric argument to the port-range validator to restrict input to numeric ports and port ranges only, rejecting service names like "ssh". This is required for VPP ACL configurations where service names are not supported.
Key Changes:
- Added argparse support to the port-range validator with a new
--only-numericflag - Modified validation logic to reject non-numeric inputs when the flag is set
- Updated VPP ACL port range XML configuration to use the new validator argument
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/validators/port-range | Added argparse with --only-numeric flag and conditional logic to reject service names when flag is enabled |
| interface-definitions/include/vpp/acl_port_range.xml.i | Updated validator call to include --only-numeric argument for VPP ACL port ranges |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
In some cases, only a numeric port or port range must be specified; service names (for example, "ssh") are not allowed
sever-sever
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extended port-range validator for numeric-only ports
As VPP wants to see integers and not ssh, for example
|
CI integration 👍 passed! Details
|
c-po
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion we should not support port name literals at all and remove code which allows for it. As VPP is new we should drop this.
VPP is the one that does not support literals. That's why this change is needed. Do not allow port name to avoid errors in VPP. But I think some other services use port names. |
In some cases, only a numeric port or port range must be specified; service names (for example, "ssh") are not allowed
Change summary
Types of changes
Related Task(s)
Related PR(s)
How to test / Smoketest result
Checklist: