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

Function foreach

src/slave/containerizer/docker.cpp:470–500  ·  view source on GitHub ↗

Unmount all persistent volumes that are no longer present.

Source from the content-addressed store, hash-verified

468#ifdef __linux__
469 // Unmount all persistent volumes that are no longer present.
470 foreach (const Resource& resource, current.persistentVolumes()) {
471 // This is enforced by the master.
472 CHECK(resource.disk().has_volume());
473
474 // Ignore absolute and nested paths.
475 const string& containerPath = resource.disk().volume().container_path();
476 if (strings::contains(containerPath, "/")) {
477 LOG(WARNING) << "Skipping updating mount for persistent volume "
478 << resource << " of container " << containerId
479 << " because the container path '" << containerPath
480 << "' contains slash";
481 continue;
482 }
483
484 if (updated.contains(resource)) {
485 continue;
486 }
487
488 const string target = path::join(
489 directory, resource.disk().volume().container_path());
490
491 Try<Nothing> unmount = fs::unmount(target);
492 if (unmount.isError()) {
493 return Error("Failed to unmount persistent volume at '" + target +
494 "': " + unmount.error());
495 }
496
497 // TODO(tnachen): Remove mount point after unmounting. This requires
498 // making sure the work directory is marked as a shared mount. For
499 // more details please refer to MESOS-3483.
500 }
501
502 // Get user and group info for this task based on the sandbox directory.
503 struct stat s;

Callers 1

usageMethod · 0.70

Calls 15

getPersistentVolumePathFunction · 0.85
chownFunction · 0.85
NoneClass · 0.85
startsWithFunction · 0.85
FailureClass · 0.85
insertMethod · 0.80
atMethod · 0.80
parseFunction · 0.70
errorMethod · 0.65
stopMethod · 0.65
containsFunction · 0.50
joinFunction · 0.50

Tested by

no test coverage detected