From 491bd2538d14ead95d61849b9e3059a278f74a13 Mon Sep 17 00:00:00 2001 From: Haakon Dybdahl Date: Tue, 11 Oct 2016 08:30:24 +0200 Subject: Clean up a bit. --- .../yahoo/vespa/hosted/dockerapi/DockerImpl.java | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'docker-api') 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) -- cgit v1.2.3