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

Method attachContainerOutput

src/slave/http.cpp:4454–4490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4452
4453
4454Future<Response> Http::attachContainerOutput(
4455 const mesos::agent::Call& call,
4456 const RequestMediaTypes& mediaTypes,
4457 const Option<Principal>& principal) const
4458{
4459 CHECK_EQ(mesos::agent::Call::ATTACH_CONTAINER_OUTPUT, call.type());
4460 CHECK(call.has_attach_container_output());
4461
4462 LOG(INFO) << "Processing ATTACH_CONTAINER_OUTPUT call for container '"
4463 << call.attach_container_output().container_id() << "'";
4464 return ObjectApprovers::create(
4465 slave->authorizer,
4466 principal,
4467 {ATTACH_CONTAINER_OUTPUT})
4468 .then(defer(
4469 slave->self(),
4470 [=](const Owned<ObjectApprovers>& approvers) -> Future<Response> {
4471 const ContainerID& containerId =
4472 call.attach_container_output().container_id();
4473
4474 Executor* executor = slave->getExecutor(containerId);
4475 if (executor == nullptr) {
4476 return NotFound(
4477 "Container " + stringify(containerId) + " cannot be found");
4478 }
4479
4480 Framework* framework = slave->getFramework(executor->frameworkId);
4481 CHECK_NOTNULL(framework);
4482
4483 if (!approvers->approved<ATTACH_CONTAINER_OUTPUT>(
4484 executor->info, framework->info, containerId)) {
4485 return Forbidden();
4486 }
4487
4488 return _attachContainerOutput(call, mediaTypes);
4489 }));
4490}
4491
4492} // namespace slave {
4493} // namespace internal {

Callers

nothing calls this directly

Calls 10

deferFunction · 0.85
NotFoundClass · 0.85
ForbiddenClass · 0.85
typeMethod · 0.80
getExecutorMethod · 0.80
createFunction · 0.50
stringifyFunction · 0.50
thenMethod · 0.45
selfMethod · 0.45
getFrameworkMethod · 0.45

Tested by

no test coverage detected