Require namespaces to be disabled explicitly

PiperOrigin-RevId: 258730797
Change-Id: I5a1df23c5176a3cecd5a343483500550f27adf44
This commit is contained in:
Wiktor Garbacz 2019-07-18 02:17:57 -07:00 committed by Copybara-Service
parent 691104c851
commit 2300141bdb

View File

@ -660,6 +660,9 @@ std::vector<sock_filter> PolicyBuilder::ResolveBpfFunc(BpfFunc f) {
}
::sapi::StatusOr<std::unique_ptr<Policy>> PolicyBuilder::TryBuild() {
CHECK_NE(use_namespaces_, disable_namespaces_)
<< "Namespaces should either be enabled (by calling EnableNamespaces(), "
"AddFile(), etc.) or disabled (by calling DisableNamespaces())";
if (!last_status_.ok()) {
return last_status_;
}