From eeeedf97dd31d6b7bf6ba89ae3f0d02d43194f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cottin?= Date: Wed, 7 Apr 2021 18:10:52 +0000 Subject: [PATCH] add ressourcesLimits for mesos 1.11 compatibility. --- isolator/test_isolator_module.cpp | 5 ++++- isolator/test_isolator_module.hpp | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/isolator/test_isolator_module.cpp b/isolator/test_isolator_module.cpp index d7f7d01..00c3b39 100644 --- a/isolator/test_isolator_module.cpp +++ b/isolator/test_isolator_module.cpp @@ -16,6 +16,8 @@ * limitations under the License. */ +#include + #include #include @@ -108,7 +110,8 @@ process::Future TestIsolatorProcess::watch( process::Future TestIsolatorProcess::update( const ContainerID& containerId, - const Resources& resources) + const Resources& resourceRequests, + const google::protobuf::Map& resourceLimits = {}) { if (!promises.contains(containerId)) { return process::Failure("Unknown container: " + stringify(containerId)); diff --git a/isolator/test_isolator_module.hpp b/isolator/test_isolator_module.hpp index aa5dbfe..1d02da4 100644 --- a/isolator/test_isolator_module.hpp +++ b/isolator/test_isolator_module.hpp @@ -19,6 +19,8 @@ #ifndef __TEST_ISOLATOR_MODULE_HPP__ #define __TEST_ISOLATOR_MODULE_HPP__ +#include + #include #include @@ -61,7 +63,8 @@ class TestIsolatorProcess : public process::Process process::Future update( const ContainerID& containerId, - const Resources& resources); + const Resources& resourceRequests, + const google::protobuf::Map& resourceLimits); process::Future usage( const ContainerID& containerId); @@ -150,12 +153,15 @@ class TestIsolator : public mesos::slave::Isolator virtual process::Future update( const ContainerID& containerId, - const Resources& resources) override + const Resources& resourceRequests, + const google::protobuf::Map< + std::string, Value::Scalar>& resourceLimits = {}) override { return dispatch(process.get(), &TestIsolatorProcess::update, containerId, - resources); + resourceRequests, + resourceLimits); } virtual process::Future usage(