]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
auth: treat mgr the same as mon when selecting auth mode
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 12 Feb 2020 02:42:39 +0000 (18:42 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 13 Feb 2020 21:49:33 +0000 (13:49 -0800)
Also use mon_cluster_modes (and not cluster_modes) when peer is mon/mgr.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/auth/AuthRegistry.cc

index 2229c8ab90660373eec03418847f0a7e67746478..897aa81f089a987e2618b791bd83699a9638de4d 100644 (file)
@@ -196,6 +196,7 @@ void AuthRegistry::get_supported_methods(
     if (modes) {
       switch (peer_type) {
       case CEPH_ENTITY_TYPE_MON:
+      case CEPH_ENTITY_TYPE_MGR:
        *modes = mon_client_modes;
        break;
       default:
@@ -204,10 +205,12 @@ void AuthRegistry::get_supported_methods(
     }
     return;
   case CEPH_ENTITY_TYPE_MON:
-    // i am mon
+  case CEPH_ENTITY_TYPE_MGR:
+    // i am mon/mgr
     switch (peer_type) {
     case CEPH_ENTITY_TYPE_MON:
-      // they are mon
+    case CEPH_ENTITY_TYPE_MGR:
+      // they are mon/mgr
       if (methods) {
        *methods = cluster_methods;
       }
@@ -230,6 +233,14 @@ void AuthRegistry::get_supported_methods(
     switch (peer_type) {
     case CEPH_ENTITY_TYPE_MON:
     case CEPH_ENTITY_TYPE_MGR:
+      // they are a mon daemon
+      if (methods) {
+       *methods = cluster_methods;
+      }
+      if (modes) {
+       *modes = mon_cluster_modes;
+      }
+      break;
     case CEPH_ENTITY_TYPE_MDS:
     case CEPH_ENTITY_TYPE_OSD:
       // they are another daemon