Skip to content
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

Ceph monitor port support (IPv4/IPv6) #424

Merged

Conversation

codenrhoden
Copy link
Contributor

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!)

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.
@codenrhoden codenrhoden added this to the 0.5.0 milestone Feb 21, 2017
@akutz
Copy link
Collaborator

akutz commented Feb 21, 2017

HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA!

@akutz akutz self-assigned this Feb 21, 2017
@akutz akutz merged commit 9e1850f into thecodeteam:release/0.5.0 Feb 21, 2017
@akutz akutz removed the in progress label Feb 21, 2017
@codenrhoden codenrhoden deleted the bugfix/ceph_monitor_ports branch April 11, 2017 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants