Open
Conversation
a4e5cb2 to
fd56c1b
Compare
Gerrit91
reviewed
Jan 8, 2026
Contributor
Gerrit91
left a comment
There was a problem hiding this comment.
Looks really good, just one remark.
| // Protocol constraints the protocol this rule applies to. | ||
| Protocol NetworkProtocol `json:"protocol"` | ||
| // To source address cidrs this rule applies to. | ||
| To []string `json:"to"` |
Contributor
There was a problem hiding this comment.
It does not have to be 100% complete (this is done by metal-api anyway) but maybe some very basic validation would be nice to prevent misconfiguration. The validations can be found api/v2/validation/firewall.go.
For me it would be sufficient to add:
- Valid protocol
- Valid CIDRs
- Valid port range
Author
There was a problem hiding this comment.
I checked the metal-api and added some basic checks. Is that what you were thinking about? Could be slightly refactored to remove duplication.
Contributor
There was a problem hiding this comment.
Yes, that was what I was thinking about. Thanks for adding these validations. :)
Please apply your refactorings and I'll give it another review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Allows specifying an initial rule set for firewall creation.
Code extracted from: #64