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

Function foreach

src/docker/docker.cpp:431–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429
430 if (devicesArray.isSome()) {
431 foreach (const JSON::Value& entry, devicesArray->values) {
432 if (!entry.is<JSON::Object>()) {
433 return Error("Malformed HostConfig.Devices"
434 " entry '" + stringify(entry) + "'");
435 }
436
437 JSON::Object object = entry.as<JSON::Object>();
438
439 Result<JSON::String> hostPath =
440 object.at<JSON::String>("PathOnHost");
441 Result<JSON::String> containerPath =
442 object.at<JSON::String>("PathInContainer");
443 Result<JSON::String> permissions =
444 object.at<JSON::String>("CgroupPermissions");
445
446 if (!hostPath.isSome() ||
447 !containerPath.isSome() ||
448 !permissions.isSome()) {
449 return Error("Malformed HostConfig.Devices entry"
450 " '" + stringify(object) + "'");
451 }
452
453 Device device;
454 device.hostPath = Path(hostPath->value);
455 device.containerPath = Path(containerPath->value);
456 device.access.read = strings::contains(permissions->value, "r");
457 device.access.write = strings::contains(permissions->value, "w");
458 device.access.mknod = strings::contains(permissions->value, "m");
459
460 devices.push_back(device);
461 }
462 }
463
464 vector<string> dns;

Callers 1

createMethod · 0.70

Calls 15

PathClass · 0.85
splitFunction · 0.85
is_absoluteFunction · 0.85
lowerFunction · 0.85
FailureClass · 0.85
typeMethod · 0.80
is_absoluteMethod · 0.80
ErrorFunction · 0.50
stringifyFunction · 0.50
containsFunction · 0.50
joinFunction · 0.50
isSomeMethod · 0.45

Tested by

no test coverage detected