This is an automated email from the ASF dual-hosted git repository. gilbert pushed a commit to branch 1.8.x in repository https://gitbox.apache.org/repos/asf/mesos.git
commit ae8c16ae7eaa5ffb301300278a18f3f662a5d8d5 Author: Qian Zhang <[email protected]> AuthorDate: Thu Aug 15 11:49:23 2019 -0700 Moved const string `.secret` to paths.hpp. Review: https://reviews.apache.org/r/71221/ (cherry picked from commit 34330fb08466116c8483ce6de234126a6089a683) --- .../containerizer/mesos/isolators/volume/secret.cpp | 16 +++++++++------- src/slave/containerizer/mesos/paths.hpp | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/slave/containerizer/mesos/isolators/volume/secret.cpp b/src/slave/containerizer/mesos/isolators/volume/secret.cpp index acd1d8f..c378256 100644 --- a/src/slave/containerizer/mesos/isolators/volume/secret.cpp +++ b/src/slave/containerizer/mesos/isolators/volume/secret.cpp @@ -14,6 +14,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "slave/containerizer/mesos/paths.hpp" + #include "slave/containerizer/mesos/isolators/volume/secret.hpp" #include <string> @@ -48,6 +50,8 @@ using process::Failure; using process::Future; using process::Owned; +using mesos::internal::slave::containerizer::paths::SECRET_DIRECTORY; + using mesos::slave::ContainerClass; using mesos::slave::ContainerConfig; using mesos::slave::ContainerLaunchInfo; @@ -58,9 +62,6 @@ namespace mesos { namespace internal { namespace slave { -constexpr char SECRET_DIR[] = ".secret"; - - Try<Isolator*> VolumeSecretIsolatorProcess::create( const Flags& flags, SecretResolver* secretResolver) @@ -70,7 +71,8 @@ Try<Isolator*> VolumeSecretIsolatorProcess::create( return Error("Volume secret isolation requires filesystem/linux isolator."); } - const string hostSecretTmpDir = path::join(flags.runtime_dir, SECRET_DIR); + const string hostSecretTmpDir = + path::join(flags.runtime_dir, SECRET_DIRECTORY); Try<Nothing> mkdir = os::mkdir(hostSecretTmpDir); if (mkdir.isError()) { @@ -122,7 +124,7 @@ Future<Option<ContainerLaunchInfo>> VolumeSecretIsolatorProcess::prepare( const string containerDir = path::join( flags.runtime_dir, - SECRET_DIR, + SECRET_DIRECTORY, stringify(containerId)); Try<Nothing> mkdir = os::mkdir(containerDir); @@ -137,7 +139,7 @@ Future<Option<ContainerLaunchInfo>> VolumeSecretIsolatorProcess::prepare( const string sandboxSecretRootDir = path::join(containerConfig.directory(), - SECRET_DIR + string("-") + stringify(id::UUID::random())); + SECRET_DIRECTORY + string("-") + stringify(id::UUID::random())); // TODO(Kapil): Add some UUID suffix to the secret-root dir to avoid conflicts // with user container_path. @@ -331,7 +333,7 @@ Future<Nothing> VolumeSecretIsolatorProcess::cleanup( { const string containerDir = path::join( flags.runtime_dir, - SECRET_DIR, + SECRET_DIRECTORY, stringify(containerId)); if (os::exists(containerDir)) { diff --git a/src/slave/containerizer/mesos/paths.hpp b/src/slave/containerizer/mesos/paths.hpp index a5e0920..339be10 100644 --- a/src/slave/containerizer/mesos/paths.hpp +++ b/src/slave/containerizer/mesos/paths.hpp @@ -81,6 +81,7 @@ constexpr char CONTAINER_DIRECTORY[] = "containers"; constexpr char CONTAINER_DEVICES_DIRECTORY[] = "devices"; constexpr char CONTAINER_LAUNCH_INFO_FILE[] = "launch_info"; constexpr char STANDALONE_MARKER_FILE[] = "standalone.marker"; +constexpr char SECRET_DIRECTORY[] = ".secret"; enum Mode
