| 3835 | |
| 3836 | template <mesos::authorization::Action action> |
| 3837 | Future<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 | |
| 3870 | Future<Response> Http::_attachContainerInput( |
nothing calls this directly
no test coverage detected