This is an automated email from the ASF dual-hosted git repository.

asekretenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 89576d8f4d322e2b2436ddd9ed882e71937ca61c
Author: Andrei Sekretenko <[email protected]>
AuthorDate: Thu Sep 17 19:37:51 2020 +0200

    Made the hierarchical allocator store `FrameworkInfo` internally.
    
    To make it possible to add into the allocator debugguing HTTP endpoints
    that will need to authorize principal's viewing access to frameworks,
    it becomes necessary to store `FrameworkInfo` in the allocator, so that
    it can compose an authorization object for the VIEW_FRAMEWORK action.
    
    Review: https://reviews.apache.org/r/72885
---
 src/master/allocator/mesos/hierarchical.cpp | 2 ++
 src/master/allocator/mesos/hierarchical.hpp | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/master/allocator/mesos/hierarchical.cpp 
b/src/master/allocator/mesos/hierarchical.cpp
index 47f8a2b..d8ebc2c 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -600,6 +600,7 @@ Framework::Framework(
     bool _active,
     bool publishPerFrameworkMetrics)
   : frameworkId(frameworkInfo.id()),
+    info(frameworkInfo),
     roles(protobuf::framework::getRoles(frameworkInfo)),
     suppressedRoles(std::move(options.suppressedRoles)),
     capabilities(frameworkInfo.capabilities()),
@@ -930,6 +931,7 @@ void HierarchicalAllocatorProcess::updateFramework(
     framework.suppressedRoles.erase(role);
   }
 
+  framework.info = frameworkInfo;
   framework.roles = newRoles;
   framework.capabilities = frameworkInfo.capabilities();
   framework.minAllocatableResources =
diff --git a/src/master/allocator/mesos/hierarchical.hpp 
b/src/master/allocator/mesos/hierarchical.hpp
index 7e1980e..225de16 100644
--- a/src/master/allocator/mesos/hierarchical.hpp
+++ b/src/master/allocator/mesos/hierarchical.hpp
@@ -87,6 +87,8 @@ struct Framework
 
   const FrameworkID frameworkId;
 
+  FrameworkInfo info;
+
   std::set<std::string> roles;
 
   std::set<std::string> suppressedRoles;

Reply via email to