mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vinodk...@apache.org
Subject [1/3] mesos git commit: Renamed `unsubscribed_frameworks` to `recovered_frameworks`.
Date Wed, 06 Jul 2016 18:34:14 GMT
Repository: mesos
Updated Branches:
  refs/heads/master d6a209a79 -> 29f848b73


Renamed `unsubscribed_frameworks` to `recovered_frameworks`.

Review: https://reviews.apache.org/r/49681/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8775f81a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8775f81a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8775f81a

Branch: refs/heads/master
Commit: 8775f81aef94a8e0513305fa7fa89b02287f1308
Parents: d6a209a
Author: haosdent huang <haosdent@gmail.com>
Authored: Wed Jul 6 13:33:35 2016 -0500
Committer: Vinod Kone <vinodkone@gmail.com>
Committed: Wed Jul 6 13:33:35 2016 -0500

----------------------------------------------------------------------
 include/mesos/master/master.proto    |  2 +-
 include/mesos/v1/master/master.proto |  2 +-
 src/master/http.cpp                  | 22 ++++++++++++++++++++--
 3 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8775f81a/include/mesos/master/master.proto
----------------------------------------------------------------------
diff --git a/include/mesos/master/master.proto b/include/mesos/master/master.proto
index 6aedc2f..236a286 100644
--- a/include/mesos/master/master.proto
+++ b/include/mesos/master/master.proto
@@ -333,7 +333,7 @@ message Response {
 
     // Frameworks that have previously subscribed but haven't yet subscribed
     // after a master failover.
-    repeated FrameworkID unsubscribed_frameworks = 3;
+    repeated FrameworkInfo recovered_frameworks = 3;
   }
 
   // Lists information about all the executors known to the master at the

http://git-wip-us.apache.org/repos/asf/mesos/blob/8775f81a/include/mesos/v1/master/master.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/master/master.proto b/include/mesos/v1/master/master.proto
index 19dbd1a..55eb2d8 100644
--- a/include/mesos/v1/master/master.proto
+++ b/include/mesos/v1/master/master.proto
@@ -334,7 +334,7 @@ message Response {
 
     // Frameworks that have previously subscribed but haven't yet subscribed
     // after a master failover.
-    repeated FrameworkID unsubscribed_frameworks = 3;
+    repeated FrameworkInfo recovered_frameworks = 3;
   }
 
   // Lists information about all the executors known to the master at the

http://git-wip-us.apache.org/repos/asf/mesos/blob/8775f81a/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index c1f5690..4ecd5d4 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -1422,8 +1422,26 @@ Future<mesos::master::Response::GetFrameworks> Master::Http::_getFrameworks(
       foreachvalue (const Slave* slave, master->slaves.registered) {
         foreachkey (const FrameworkID& frameworkId, slave->tasks) {
           if (!master->frameworks.registered.contains(frameworkId)) {
-            getFrameworks.add_unsubscribed_frameworks()
-                ->set_value(frameworkId.value());
+            // TODO(haosdent): This logic should be simplified after
+            // a deprecation cycle starting with 1.0 as after that
+            // we can rely on `master->frameworks.recovered` containing
+            // all FrameworkInfos.
+            // Until then there are 3 cases:
+            // - No authorization enabled: show all orphaned frameworks.
+            // - Authorization enabled, but no FrameworkInfo present:
+            //   do not show orphaned frameworks.
+            // - Authorization enabled, FrameworkInfo present: filter
+            //   based on `approveViewFrameworkInfo`.
+            if (master->authorizer.isSome() &&
+               (!master->frameworks.recovered.contains(frameworkId) ||
+                !approveViewFrameworkInfo(
+                    frameworksApprover,
+                    master->frameworks.recovered[frameworkId]))) {
+              continue;
+            }
+
+            getFrameworks.add_recovered_frameworks()->CopyFrom(
+                master->frameworks.recovered[frameworkId]);
           }
         }
       }


Mime
View raw message