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

Method _removeContainer

src/slave/http.cpp:3837–3867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3835
3836template <mesos::authorization::Action action>
3837Future<Response> Http::_removeContainer(
3838 const ContainerID& containerId,
3839 ContentType acceptType,
3840 const Owned<ObjectApprovers>& approvers) const
3841{
3842 // Attempt to get the executor associated with this ContainerID.
3843 // We only expect to get the executor when removing a nested container
3844 // under a container launched via a scheduler. In other cases, we are
3845 // removing a standalone container (possibly nested).
3846 Executor* executor = slave->getExecutor(containerId);
3847 if (executor == nullptr) {
3848 if (!approvers->approved<action>(containerId)) {
3849 return Forbidden();
3850 }
3851 } else {
3852 Framework* framework = slave->getFramework(executor->frameworkId);
3853 CHECK_NOTNULL(framework);
3854
3855 if (!approvers->approved<action>(
3856 executor->info,
3857 framework->info,
3858 containerId)) {
3859 return Forbidden();
3860 }
3861 }
3862
3863 Future<Nothing> remove = slave->containerizer->remove(containerId);
3864
3865 return remove
3866 .then([=]() -> Response { return OK(); });
3867}
3868
3869
3870Future<Response> Http::_attachContainerInput(

Callers

nothing calls this directly

Calls 6

ForbiddenClass · 0.85
OKClass · 0.85
getExecutorMethod · 0.80
getFrameworkMethod · 0.45
removeMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected