-
Notifications
You must be signed in to change notification settings - Fork 242
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
Check if bmc hostname follows DNS Standard #1068
Conversation
@@ -368,7 +368,7 @@ func TestParse(t *testing.T) { | |||
}, | |||
} { | |||
t.Run(tc.Scenario, func(t *testing.T) { | |||
url, err := getParsedURL(tc.Address) | |||
url, err := GetParsedURL(tc.Address) |
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.
I think, tests including invalid dns cases might be added?
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.
We really need lots of tests to assure that is working.
} | ||
|
||
// Check if its a IPv6/IPv4 address | ||
if net.ParseIP(address) != nil { |
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 this line, we have a DNS value, why we are parsing assuming that it is IP?
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 lot of tests we have IPv6 address ( and I think the BMC address hostname can be an IPv6 address) - this check is validate that. IPv4 addresses are anyways DNS standard compliant, so it doesn't need a check - I will remove IPv4 from the comment to avoid this confusion.
This PR looks good to me, but I'll not label to someone else have a look at; /test-v1b1-centos-integration |
/test-v1b1-centos-integration Sems good to me, but like @ardaguclu said, we need to add corresponding test cases for this. |
Would it make sense to add test cases here or at the baremetalhost_valitations level |
I think both places need their own corresponding tests. |
/test-v1b1-centos-integration |
/test-v1b1-centos-integration |
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.
LGTM
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dtantsur The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
Adds a function to check if the bmc.address follows DNS standard and exports the GetParsedURL function to make it available in other validations.