MCPcopy Create free account
hub / github.com/apache/mesos / validateRevocableAndNonRevocableResources

Function validateRevocableAndNonRevocableResources

src/master/validation.cpp:942–954  ·  view source on GitHub ↗

Validates that revocable and non-revocable resources of the same name do not exist. TODO(vinod): Is this the right place to do this?

Source from the content-addressed store, hash-verified

940//
941// TODO(vinod): Is this the right place to do this?
942Option<Error> validateRevocableAndNonRevocableResources(
943 const Resources& _resources)
944{
945 foreach (const string& name, _resources.names()) {
946 Resources resources = _resources.get(name);
947 if (!resources.revocable().empty() && resources != resources.revocable()) {
948 return Error("Cannot use both revocable and non-revocable '" + name +
949 "' at the same time");
950 }
951 }
952
953 return None();
954}
955
956
957// Validates that all the given resources are persistent volumes.

Calls 1

NoneClass · 0.85

Tested by

no test coverage detected