]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: udpate options yaml file so LDAP uri isn't an invalid example 56721/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 3 Apr 2024 03:10:12 +0000 (23:10 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Fri, 5 Apr 2024 15:57:37 +0000 (11:57 -0400)
LDAP tries to bind the URI configuration option when RGW starts. The
default value is an example used to show the form of the URI and is
not itself valid. The default value is used, unless overrideen, and
can cause delays in start-up in some situations. The example is now
provided in the description and the default is the empty string.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 236f1dfa9ae507940a53301f31da7974456c82fe)

src/common/options/rgw.yaml.in
src/rgw/rgw_appmain.cc

index 9c7f91f9e0d981b11ab49389e924fd6e93564221..bdefaba68bc99c5e164d8cc021ceab37c6a3ab79 100644 (file)
@@ -897,8 +897,8 @@ options:
 - name: rgw_ldap_uri
   type: str
   level: advanced
-  desc: Space-separated list of LDAP servers in URI format.
-  default: ldaps://<ldap.your.domain>
+  desc: Space-separated list of LDAP servers in URI format, e.g., "ldaps://<ldap.your.domain>".
+  default:
   services:
   - rgw
   with_legacy: true
index 361f622b992a70428b99a0e130c1c846012b2c8f..ed92cc2886a3ad716e79eb0a3315ef4eef67265f 100644 (file)
@@ -339,6 +339,11 @@ void rgw::AppMain::init_ldap()
   const string &ldap_dnattr = cct->_conf->rgw_ldap_dnattr;
   std::string ldap_bindpw = parse_rgw_ldap_bindpw(cct);
 
+  if (ldap_uri.empty()) {
+    derr << "LDAP not started since no server URIs were provided in the configuration." << dendl;
+    return;
+  }
+
   ldh.reset(new rgw::LDAPHelper(ldap_uri, ldap_binddn,
             ldap_bindpw.c_str(), ldap_searchdn, ldap_searchfilter, ldap_dnattr));
   ldh->init();