]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix CephExporter protocol bind logic 58095/head
authorMouratidis Theofilos <mtheofilos@gmail.com>
Fri, 10 May 2024 10:17:12 +0000 (12:17 +0200)
committerAdam King <adking@redhat.com>
Mon, 17 Jun 2024 17:42:46 +0000 (13:42 -0400)
In a dual stack configuration ceph-exporter binds to ipv4 only and the metrics fail in ipv6

Signed-off-by: Mouratidis Theofilos <mtheofilos@gmail.com>
(cherry picked from commit 110bc665078fe19c31e3680c4197587e69e4e751)

src/cephadm/cephadmlib/daemons/ceph.py

index e6392876cc60d0fc9898ecb63b04c69f95747650..55a92835129769eda0e0053a0b38abde8693fc4a 100644 (file)
@@ -292,8 +292,8 @@ class CephExporter(ContainerDaemonForm):
         self.image = image
 
         self.sock_dir = config_json.get('sock-dir', '/var/run/ceph/')
-        ipv4_addrs, _ = get_ip_addresses(get_hostname())
-        addrs = '0.0.0.0' if ipv4_addrs else '::'
+        _, ipv6_addrs = get_ip_addresses(get_hostname())
+        addrs = '::' if ipv6_addrs else '0.0.0.0'
         self.addrs = config_json.get('addrs', addrs)
         self.port = config_json.get('port', self.DEFAULT_PORT)
         self.prio_limit = config_json.get('prio-limit', 5)