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

Method DockerFilter

src/tests/environment.cpp:298–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296{
297public:
298 DockerFilter()
299 {
300#if defined(__linux__) || defined(__WINDOWS__)
301 Try<Owned<Docker>> docker = Docker::create(
302 flags.docker,
303 flags.docker_socket);
304
305 if (!docker.isError()) {
306 Try<Nothing> version = docker.get()->validateVersion(Version(1, 9, 0));
307 if (version.isError()) {
308 dockerUserNetworkError = version.error();
309 }
310 } else {
311 dockerError = docker.error();
312 }
313
314#ifdef __WINDOWS__
315 // On Windows, the ability to enter another container's namespace was
316 // enabled on newer Windows builds (>=1709). So, check if we can do
317 // this to run the docker health check tests.
318 LOG(WARNING) << "Testing shared container network namespaces on Windows. "
319 << "This might take up to 30 seconds...";
320
321 if (dockerError.isNone() && dockerUserNetworkError.isNone()) {
322 dockerNamespaceError = runNetNamespaceCheck(docker.get());
323 }
324#endif // __WINDOWS__
325#else
326 dockerError = Error("Docker tests are not supported on this platform");
327#endif // __linux__ || __WINDOWS__
328
329 if (dockerError.isSome()) {
330 std::cerr
331 << "-------------------------------------------------------------\n"
332 << "We cannot run any Docker tests because:\n"
333 << dockerError->message << "\n"
334 << "-------------------------------------------------------------"
335 << std::endl;
336 }
337
338 if (dockerUserNetworkError.isSome()) {
339 std::cerr
340 << "-------------------------------------------------------------\n"
341 << "We cannot run any Docker user network tests because:\n"
342 << dockerUserNetworkError->message << "\n"
343 << "-------------------------------------------------------------"
344 << std::endl;
345 }
346
347 if (dockerNamespaceError.isSome()) {
348 std::cerr
349 << "-------------------------------------------------------------\n"
350 << "We cannot run any Docker network health checks tests because:\n"
351 << dockerNamespaceError->message << "\n"
352 << "-------------------------------------------------------------"
353 << std::endl;
354 }
355 }

Callers

nothing calls this directly

Calls 9

validateVersionMethod · 0.80
errorMethod · 0.65
createFunction · 0.50
VersionEnum · 0.50
ErrorFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45
isNoneMethod · 0.45
isSomeMethod · 0.45

Tested by

no test coverage detected