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

Function validateDynamicReservationInfo

src/master/validation.cpp:849–865  ·  view source on GitHub ↗

Validates the ReservationInfos specified in the given resources (if exist). Returns error if any ReservationInfo is found invalid or unsupported.

Source from the content-addressed store, hash-verified

847// exist). Returns error if any ReservationInfo is found invalid or
848// unsupported.
849Option<Error> validateDynamicReservationInfo(
850 const RepeatedPtrField<Resource>& resources)
851{
852 foreach (const Resource& resource, resources) {
853 if (!Resources::isDynamicallyReserved(resource)) {
854 continue;
855 }
856
857 if (Resources::isRevocable(resource)) {
858 return Error(
859 "Dynamically reserved resource " + stringify(resource) +
860 " cannot be created from revocable resources");
861 }
862 }
863
864 return None();
865}
866
867
868// Validates the DiskInfos specified in the given resources (if

Callers 1

validateFunction · 0.85

Calls 1

NoneClass · 0.85

Tested by

no test coverage detected