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

Method validateVersion

src/docker/docker.cpp:262–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260
261
262Try<Nothing> Docker::validateVersion(const Version& minVersion) const
263{
264 // Validate the version (and that we can use Docker at all).
265 Future<Version> version = this->version();
266
267 if (!version.await(DOCKER_VERSION_WAIT_TIMEOUT)) {
268 return Error("Timed out getting docker version");
269 }
270
271 if (version.isFailed()) {
272 return Error("Failed to get docker version: " + version.failure());
273 }
274
275 if (version.get() < minVersion) {
276 string msg = "Insufficient version '" + stringify(version.get()) +
277 "' of Docker. Please upgrade to >=' " +
278 stringify(minVersion) + "'";
279 return Error(msg);
280 }
281
282 return Nothing();
283}
284
285
286// TODO(josephw): Parse this string with a protobuf.

Callers 2

DockerFilterMethod · 0.80
createMethod · 0.80

Calls 8

NothingClass · 0.85
versionMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
ErrorFunction · 0.50
stringifyFunction · 0.50
awaitMethod · 0.45
getMethod · 0.45

Tested by 1

DockerFilterMethod · 0.64