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

Function validateFramework

src/master/validation.cpp:2264–2284  ·  view source on GitHub ↗

Validates that all offers belongs to the expected framework.

Source from the content-addressed store, hash-verified

2262
2263// Validates that all offers belongs to the expected framework.
2264Option<Error> validateFramework(
2265 const RepeatedPtrField<OfferID>& offerIds,
2266 Master* master,
2267 Framework* framework)
2268{
2269 foreach (const OfferID& offerId, offerIds) {
2270 Try<FrameworkID> offerFrameworkId = getFrameworkId(master, offerId);
2271 if (offerFrameworkId.isError()) {
2272 return offerFrameworkId.error();
2273 }
2274
2275 if (framework->id() != offerFrameworkId.get()) {
2276 return Error(
2277 "Offer " + stringify(offerId) +
2278 " has invalid framework " + stringify(offerFrameworkId.get()) +
2279 " while framework " + stringify(framework->id()) + " is expected");
2280 }
2281 }
2282
2283 return None();
2284}
2285
2286
2287// Validate that all offers in one operation must be

Callers 2

subscribeMethod · 0.85
updateFrameworkMethod · 0.85

Calls 1

NoneClass · 0.85

Tested by

no test coverage detected