Ceph monitor port support (IPv4/IPv6) #424
Merged
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.
Came across this during early testing for 0.5.0-RC2. Without this fix, any use of the rbd driver on clusters without a monitor port defined fails, which is likely the majority. This fixes a regression introduced by 1040f4c.
Previous fix to support Ceph monitors with non standard ports caused a
new issue for monitors without ports. The call to net.SplitHostPort()
fails if the string does not contain a ":".
Rework the parsing of monitor addresses to account for the
presence/absence of ports, both for IPv4 and IPv6. As it turns out, The
Ceph config file also requires that IPv6 addresses (but not ports!) be
enclosed by brackets, which is the same requirement for
net.SplitHostPort(), and is something taken advantage of in this patch.
Tests added to cover possible combinations. Tests pass (and in fact, made me rework this solution several times!)