You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2017/03/06 20:40:50 UTC

[14/14] mesos git commit: Added default parameter value to master validation function.

Added default parameter value to master validation function.

The master's validation function for RESERVE operations previously
did not set a default parameter value for its final optional
parameter, requiring callsites to explicitly specify `None()`. This
patch adds the default value.

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


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

Branch: refs/heads/master
Commit: 072638d252bff6df6d89c2d3d0cf2220c98e677f
Parents: 17ef4dd
Author: Greg Mann <gr...@mesosphere.io>
Authored: Mon Mar 6 12:40:11 2017 -0800
Committer: Vinod Kone <vi...@gmail.com>
Committed: Mon Mar 6 12:40:11 2017 -0800

----------------------------------------------------------------------
 src/master/http.cpp       | 2 +-
 src/master/validation.hpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/072638d2/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 713ee0f..0bbb922 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -2279,7 +2279,7 @@ Future<Response> Master::Http::_reserve(
   operation.mutable_reserve()->mutable_resources()->CopyFrom(resources);
 
   Option<Error> error = validation::operation::validate(
-      operation.reserve(), principal, None());
+      operation.reserve(), principal);
 
   if (error.isSome()) {
     return BadRequest("Invalid RESERVE operation: " + error.get().message);

http://git-wip-us.apache.org/repos/asf/mesos/blob/072638d2/src/master/validation.hpp
----------------------------------------------------------------------
diff --git a/src/master/validation.hpp b/src/master/validation.hpp
index ad254b2..d96287d 100644
--- a/src/master/validation.hpp
+++ b/src/master/validation.hpp
@@ -234,7 +234,7 @@ namespace operation {
 Option<Error> validate(
     const Offer::Operation::Reserve& reserve,
     const Option<process::http::authentication::Principal>& principal,
-    const Option<FrameworkInfo>& frameworkInfo);
+    const Option<FrameworkInfo>& frameworkInfo = None());
 
 
 // Validates the UNRESERVE operation.