]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: iscsi username and password defaults to admin 48304/head
authorNizamudeen A <nia@redhat.com>
Thu, 29 Sep 2022 19:59:39 +0000 (01:29 +0530)
committerNizamudeen A <nia@redhat.com>
Fri, 7 Oct 2022 07:59:29 +0000 (13:29 +0530)
A while ago, the iscsi username and password were defaulted to admin the
config_dashboard part. But it was not saved to the
`iscsi-gateway.cfg.j2` which results in a misconfiguration.

For eg, if you deploy an iscsi service with service_spec which doesn't
have the api_user and api_password field it results the dashboard to
show the gateways as always down because dashboard was unable to make
request to the iscsi server and every api calls result in a `[dashboard
ERROR rest_client] iscsi REST API failed GET req status: 401`.

Fixes: https://tracker.ceph.com/issues/57730
Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/services/tcmu_service.py
src/python-common/ceph/deployment/service_spec.py
src/python-common/ceph/tests/test_service_spec.py

index 9defa2f18e630a53ce37fa561343125d42829160..a81b6e8f2224570e2e88ba2b84805e8e6078046e 100644 (file)
@@ -20,6 +20,7 @@ class TcmuService(object):
     def get_iscsi_info():
         daemons = {}  # type: Dict[str, dict]
         images = {}  # type: Dict[str, dict]
+        daemon = None
         for service in CephService.get_service_list(SERVICE_TYPE):
             metadata = service['metadata']
             if metadata is None:
index 16db5ed7cc4e423712aca738e1d59a370576daf0..af9780c9a426fa467f9cf00c2e12ed7a605ddfc6 100644 (file)
@@ -928,9 +928,9 @@ class IscsiServiceSpec(ServiceSpec):
                  service_id: Optional[str] = None,
                  pool: Optional[str] = None,
                  trusted_ip_list: Optional[str] = None,
-                 api_port: Optional[int] = None,
-                 api_user: Optional[str] = None,
-                 api_password: Optional[str] = None,
+                 api_port: Optional[int] = 5000,
+                 api_user: Optional[str] = 'admin',
+                 api_password: Optional[str] = 'admin',
                  api_secure: Optional[bool] = None,
                  ssl_cert: Optional[str] = None,
                  ssl_key: Optional[str] = None,
index d3fb4329668bb74d193a10669969f888eced5703..28dc1680f0f0c8d4069955568f7178e22d122d7f 100644 (file)
@@ -283,7 +283,9 @@ service_name: iscsi.iscsi
 networks:
 - ::0/8
 spec:
-  api_user: api_user
+  api_password: admin
+  api_port: 5000
+  api_user: admin
   pool: pool
   trusted_ip_list:
   - ::1