]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr/mgr_module: make get_mgr_ip() return mgr's IP from mgrmap
authorSage Weil <sage@newdream.net>
Wed, 2 Jun 2021 02:31:11 +0000 (22:31 -0400)
committerSage Weil <sage@newdream.net>
Fri, 4 Jun 2021 02:05:16 +0000 (21:05 -0500)
commit9fe6382e8b37aaad4d0af8f7eb5c254225e96f34
tree4eeecc7f69e21c1571f013e21b2fb4d3c7dab0c1
parentdf03e6587fe19552e8a76d87b0d4ce333df1b502
pybind/mgr/mgr_module: make get_mgr_ip() return mgr's IP from mgrmap

The previous approach was convoluted: we tried to do a DNS lookup on the
hostname, which would fail if /etc/hosts had an entry.  Which, with podman,
it does.  And the IP it has will vary in all sorts of weird ways.  For
example, CNI on my host means that I get a dynamic address in 10.88.0.0/24.

Avoid all of that nonsense and use the IP that is in the mgrmap.  There
may be multiple IPs (v2 + v1, or maybe even IPv4 + v6 in the future); in
that case, use the first one.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 72d72fc5db33110effdbfcdfd19e086d4dd831be)
src/mgr/ActivePyModules.cc
src/pybind/mgr/mgr_module.py