]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Thu, 3 Jun 2021 16:11:31 +0000 (12:11 -0400)
commit72d72fc5db33110effdbfcdfd19e086d4dd831be
treeb8964cd4a22d3a14a727cea03117f3a039451eba
parentdf7994617438a53db84edfd1e83c8439e0cad8f6
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>
src/mgr/ActivePyModules.cc
src/pybind/mgr/mgr_module.py