This is an automated email from the ASF dual-hosted git repository. gilbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 0293cc2d4ce25b113b4f1b8a34b34a0655132f9b Author: Qian Zhang <[email protected]> AuthorDate: Thu Mar 7 16:42:09 2019 -0800 Made volume gid manager allocate & deallocate gid to non-shared PV. Review: https://reviews.apache.org/r/70137/ --- .../containerizer/mesos/isolators/filesystem/linux.cpp | 13 ++++++------- .../containerizer/mesos/isolators/filesystem/posix.cpp | 13 ++++++------- src/slave/slave.cpp | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp b/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp index 341853a..725754f 100644 --- a/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp +++ b/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp @@ -878,14 +878,13 @@ Future<Nothing> LinuxFilesystemIsolatorProcess::update( // changes about the volume's ownership since it has the full permissions // to access the volume. if (uid != 0) { - // For shared persistent volume, if volume gid manager is enabled, call - // volume gid manager to allocate a gid to make sure the container has - // the permission to access the volume. + // For persistent volumes not from resource providers, if volume gid + // manager is enabled, call volume gid manager to allocate a gid to + // make sure the container has the permission to access the volume. // - // TODO(qianzhang): Support gid allocation for shared persistent volumes - // from resource providers. - if (resource.has_shared() && - !Resources::hasResourceProvider(resource) && + // TODO(qianzhang): Support gid allocation for persistent volumes from + // resource providers. + if (!Resources::hasResourceProvider(resource) && volumeGidManager) { LOG(INFO) << "Invoking volume gid manager to allocate gid to the " << "volume path '" << source << "' for container " diff --git a/src/slave/containerizer/mesos/isolators/filesystem/posix.cpp b/src/slave/containerizer/mesos/isolators/filesystem/posix.cpp index 08449e2..dbf149a 100644 --- a/src/slave/containerizer/mesos/isolators/filesystem/posix.cpp +++ b/src/slave/containerizer/mesos/isolators/filesystem/posix.cpp @@ -217,14 +217,13 @@ Future<Nothing> PosixFilesystemIsolatorProcess::update( // changes about the volume's ownership since it has the full permissions // to access the volume. if (uid != 0) { - // For shared persistent volume, if volume gid manager is enabled, call - // volume gid manager to allocate a gid to make sure the container has - // the permission to access the volume. + // For persistent volumes not from resource providers, if volume gid + // manager is enabled, call volume gid manager to allocate a gid to + // make sure the container has the permission to access the volume. // - // TODO(qianzhang): Support gid allocation for shared persistent volumes - // from resource providers. - if (resource.has_shared() && - !Resources::hasResourceProvider(resource) && + // TODO(qianzhang): Support gid allocation for persistent volumes from + // resource providers. + if (!Resources::hasResourceProvider(resource) && volumeGidManager) { #ifndef __WINDOWS__ LOG(INFO) << "Invoking volume gid manager to allocate gid to the " diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp index 4073d8a..36424f8 100644 --- a/src/slave/slave.cpp +++ b/src/slave/slave.cpp @@ -4405,7 +4405,7 @@ Try<Nothing> Slave::syncCheckpointedResources( // Deallocate the shared persistent volume's gid. Please note that the // gid is allocated when the shared persistent volume is first used by // a container rather than when it is created. - if (volume.has_shared() && volumeGidManager) { + if (volumeGidManager) { volumeGidManager->deallocate(path); } #endif // __WINDOWS__
