]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: iscsi username and password defaults to admin 49310/head
authorNizamudeen A <nia@redhat.com>
Thu, 29 Sep 2022 19:59:39 +0000 (01:29 +0530)
committerAdam King <adking@redhat.com>
Wed, 7 Dec 2022 17:10:50 +0000 (12:10 -0500)
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>
(cherry picked from commit bf87bc797ff0b47a60f7169698bb8ed2a5080c14)

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 aceeaff3de042097a8f7fc10d6c477bcaf578ea9..1155c1d5c6f458c1fe26ec70131ec69f6d9c23b7 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 17130ea9a379c83b6d8286c9499117144fea4e61..8e6f813e66e437cd524d4a69efe0216363855c73 100644 (file)
@@ -858,9 +858,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