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

Function validateCheckStatusInfo

src/common/validation.cpp:502–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500
501
502Option<Error> validateCheckStatusInfo(const CheckStatusInfo& checkStatusInfo)
503{
504 if (!checkStatusInfo.has_type()) {
505 return Error("CheckStatusInfo must specify 'type'");
506 }
507
508 switch (checkStatusInfo.type()) {
509 case CheckInfo::COMMAND: {
510 if (!checkStatusInfo.has_command()) {
511 return Error(
512 "Expecting 'command' to be set for COMMAND check's status");
513 }
514 break;
515 }
516 case CheckInfo::HTTP: {
517 if (!checkStatusInfo.has_http()) {
518 return Error("Expecting 'http' to be set for HTTP check's status");
519 }
520 break;
521 }
522 case CheckInfo::TCP: {
523 if (!checkStatusInfo.has_tcp()) {
524 return Error("Expecting 'tcp' to be set for TCP check's status");
525 }
526 break;
527 }
528 case CheckInfo::UNKNOWN: {
529 return Error(
530 "'" + CheckInfo::Type_Name(checkStatusInfo.type()) + "'"
531 " is not a valid check's status type");
532 }
533 }
534
535 return None();
536}
537
538Option<Error> validateExecutorCall(const mesos::executor::Call& call)
539{

Callers 2

TEST_FFunction · 0.85
validateExecutorCallFunction · 0.85

Calls 3

NoneClass · 0.85
typeMethod · 0.80
ErrorFunction · 0.50

Tested by 1

TEST_FFunction · 0.68