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

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

commit 231321559485ea4b6e3024b86c74914065521e45
Author: Benno Evers <[email protected]>
AuthorDate: Fri Nov 8 14:03:48 2019 +0100

    Rejected scheduler calls that include reservation updates.
    
    Until reservation updates are implemented, ensure
    that calls making use of them are properly rejected.
    
    Review: https://reviews.apache.org/r/71687/
---
 src/master/master.cpp | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/master/master.cpp b/src/master/master.cpp
index bbbc076..e7609f3 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -4484,6 +4484,30 @@ void Master::accept(
 
     foreach (Offer::Operation& operation, operations) {
       Option<Error> error = validateAndUpgradeResources(&operation);
+
+      // Additional operation-specific validation.
+      if (error.isNone()) {
+        switch (operation.type()) {
+          case Offer::Operation::RESERVE:
+            if (!operation.reserve().source().empty()) {
+              error = Error("Reservation updates are not yet implemented"
+                            " for the scheduler API.");
+            }
+            break;
+          case Offer::Operation::UNRESERVE:
+          case Offer::Operation::CREATE:
+          case Offer::Operation::DESTROY:
+          case Offer::Operation::GROW_VOLUME:
+          case Offer::Operation::SHRINK_VOLUME:
+          case Offer::Operation::CREATE_DISK:
+          case Offer::Operation::DESTROY_DISK:
+          case Offer::Operation::LAUNCH:
+          case Offer::Operation::LAUNCH_GROUP:
+          case Offer::Operation::UNKNOWN:
+            break;
+        }
+      }
+
       if (error.isSome()) {
         switch (operation.type()) {
           case Offer::Operation::RESERVE:

Reply via email to