ceph: fail if mgr prometheus is not default

Currently, Rook does not support a prometheus exporter port different
than 9283 so let's fail and force the user to set it to the default.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han committed 2020-11-04 10:52:58 +01:00
1 parent 5814e43364
commit 1ed307cb09
1 file changed
+9 -2
@@ -362,8 +362,15 @@ class RadosJSON:
monitoring_endpoint = self._join_host_port(monitoring_endpoint_ip, monitoring_endpoint_port)
self._invalid_endpoint(monitoring_endpoint)
self.endpoint_dial(monitoring_endpoint)
self.validate_monitoring_endpoint(monitoring_endpoint_port)
return monitoring_endpoint_ip, monitoring_endpoint_port
def validate_monitoring_endpoint(self, port):
if port != self.DEFAULT_MONITORING_ENDPOINT_PORT:
raise ExecutionFailureException(
"'prometheus' service port must listen on {}. You can change it with 'ceph config set mgr mgr/prometheus/server_port {}'.\n".format(self.DEFAULT_MONITORING_ENDPOINT_PORT, self.DEFAULT_MONITORING_ENDPOINT_PORT))
def create_cephCSIKeyring_cephFSProvisioner(self):
'''
command: ceph auth get-or-create client.csi-cephfs-provisioner mon 'allow r' mgr 'allow rw' osd 'allow rw tag cephfs metadata=*'
@@ -937,8 +944,8 @@ class TestRadosJSON(unittest.TestCase):
self.rjObj = RadosJSON(['--rbd-data-pool-name=abc', '--format=json'])
self.rjObj.cluster = DummyRados.Rados()
valid_ip_ports = [("10.22.31.131", "3534"),
("10.177.3.81", ""), ("", ""), ("", "9092")]
valid_ip_ports = [("10.22.31.131", "9283"),
("10.177.3.81", ""), ("", ""), ("", "9283")]
for each_ip_port_pair in valid_ip_ports:
# reset monitoring ip and port
self.rjObj._arg_parser.monitoring_endpoint = ''