]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: don't add mgr into iscsi trusted_ip_list if it's already there 50631/head
authorMykola Golub <mykola.golub@clyso.com>
Thu, 16 Feb 2023 09:33:45 +0000 (11:33 +0200)
committerMykola Golub <mykola.golub@clyso.com>
Wed, 22 Mar 2023 17:05:58 +0000 (19:05 +0200)
Fixes: https://tracker.ceph.com/issues/58792
Signed-off-by: Mykola Golub <mykola.golub@clyso.com>
(cherry picked from commit 4a74a020a7754f0dac533a50e085f5690df90798)

src/pybind/mgr/cephadm/services/iscsi.py

index c42eff6838d9a1120d04edc4c4b3d9794811a6d7..61b157b444ca1a969ee7807cc63815711ca6ee07 100644 (file)
@@ -26,9 +26,11 @@ class IscsiService(CephService):
     def get_trusted_ips(self, spec: IscsiServiceSpec) -> str:
         # add active mgr ip address to trusted list so dashboard can access
         trusted_ip_list = spec.trusted_ip_list if spec.trusted_ip_list else ''
-        if trusted_ip_list:
-            trusted_ip_list += ','
-        trusted_ip_list += self.mgr.get_mgr_ip()
+        mgr_ip = self.mgr.get_mgr_ip()
+        if mgr_ip not in [s.strip() for s in trusted_ip_list.split(',')]:
+            if trusted_ip_list:
+                trusted_ip_list += ','
+            trusted_ip_list += mgr_ip
         return trusted_ip_list
 
     def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonDeploySpec: