diff options
author | Haakon Dybdahl <dybdahl@yahoo-inc.com> | 2016-10-11 08:30:24 +0200 |
---|---|---|
committer | Haakon Dybdahl <dybdahl@yahoo-inc.com> | 2016-10-11 08:30:24 +0200 |
commit | 491bd2538d14ead95d61849b9e3059a278f74a13 (patch) | |
tree | 0b59c9ac5094a877e68c602c1981c536fbcc51a3 /docker-api/src | |
parent | 4509bcc22eea8db77ff8aa99e9c942b2966fd5cb (diff) |
Clean up a bit.
Diffstat (limited to 'docker-api/src')
-rw-r--r-- | docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java index b82759aeb1b..73723874c99 100644 --- a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java +++ b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java @@ -93,7 +93,7 @@ public class DockerImpl implements Docker { .withConnectTimeout(DOCKER_CONNECT_TIMEOUT_MILLIS) .withReadTimeout(DOCKER_READ_TIMEOUT_MILLIS); // Fail fast - RemoteApiVersion remoteApiVersion = findCorrectRemoteApiVersion(config, 100 /* connect timeout millis */); + RemoteApiVersion remoteApiVersion = getRemoteApiVersion(config, 100 /* connect timeout millis */); this.dockerClient = DockerClientImpl.getInstance( buildDockerClientConfig(config) .withApiVersion(remoteApiVersion) @@ -563,25 +563,6 @@ public class DockerImpl implements Docker { } } - private RemoteApiVersion findCorrectRemoteApiVersion(final DockerConfig config, int connectTimeousMillis) { - RemoteApiVersion remoteApiVersion; - try { - // Fail fast - remoteApiVersion = getRemoteApiVersion(config, connectTimeousMillis); - logger.info("Found version of remote docker API: " + remoteApiVersion); - // From version 1.24 a field was removed which causes trouble with the current docker java code. - // When this is fixed, we can remove this and do not specify version. - if (remoteApiVersion.isGreaterOrEqual(RemoteApiVersion.VERSION_1_24)) { - logger.info("Found version 1.24 or newer of remote API, using 1.23."); - return RemoteApiVersion.VERSION_1_23; - } - return remoteApiVersion; - } catch (Exception e) { - logger.log(LogLevel.ERROR, "Failed when trying to figure out remote API version of docker, using 1.23", e); - return RemoteApiVersion.VERSION_1_23; - } - } - private static RemoteApiVersion getRemoteApiVersion(final DockerConfig config, int connectTimeousMs) { JerseyDockerCmdExecFactory dockerFactory = new JerseyDockerCmdExecFactory() .withMaxPerRouteConnections(DOCKER_MAX_PER_ROUTE_CONNECTIONS) |