-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix: allow FQDNs as controlPlaneEndpoint #157
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.
This still accepts ip address ?
@mcbenjemaa yes. Just double checked it and added some testcases for plain ipv4 / ipv6 endpoints. After all, all we do here is, prior to running our actual tests, checking if the controlPlaneEndpoint is a resolvable FQDN and if so, continue with it's 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.
This works, but is a bit awkward. Since we agreed that I'll be taking over, no further action is required.
A couple of remarks:
isValidFQDN
is actually a test if a hostname resolves, and has nothing to do with FQDNs. There's no requirement on a hostname needing to be an FQDN to be valid.- You can resolve hostnames which are illegal as actual hostnames. As an example,
_acme-challenge.your.domain
is valid to resolve, but not a hostname. This is useful for text type records. - We're now implicitly depending on endpointHostIP not returning square brackets. I don't think this assumption holds
It does and we should not accept them here. Otherwise we have to strip them again in other places, where it is passed to other resources. We've already been there and passing a |
I have tested ipv6, but it doesn't work for proxmoxcluster. But the cluster was created successfully
also when i put a hostname in the controlplaneendpoint, it works for cluster but not for ProxmoxCluster. those cases don't work:
|
With square brackets is not supposed to work. And if the other ones don't resolve, they're not supposed to work either, as with my change the IP behind the FQDN is required for further endpoint validation. |
CAPI doesn't have any validation for this field, i think you can omit validation for the host. |
Either we validate the host, or we ditch the |
We keep validations of IPs of the ipam, and the validation of collides with endpoint ip. |
fixes #153 |
I have raised this PR, that will make cluster to fail if machine has failed cloud-init run: |
This is done here. The PR is rather small, a couple of naming changes and a function to detect hostnames. |
Quality Gate passedIssues Measures |
Issue #, if available:
fixes #153
Description of changes:
Checks if the passed
controlPlaneEndpoint.host
is a resolvable FQDN, and if true, uses the IP from it for further validation.Testing performed:
See chat.