Skip to content

Commit cf4769f

Browse files
committed
Update to docker-client 10
1 parent 3b055cb commit cf4769f

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

containers/org.eclipse.linuxtools.docker.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.28.0",
1111
org.eclipse.equinox.registry;bundle-version="3.11.300",
1212
org.eclipse.equinox.security,
1313
org.eclipse.osgi,
14-
org.mandas.docker-client;bundle-version="7.0.7",
14+
org.mandas.docker-client;bundle-version="10.0.0",
1515
org.glassfish.jersey.core.jersey-client;bundle-version="3.1.5",
1616
org.glassfish.jersey.media.jersey-media-json-jackson;bundle-version="3.1.5",
1717
org.glassfish.jersey.core.jersey-common;bundle-version="3.1.5",

containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerClientFactory.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,33 @@ public DockerClient getClient(
6969
final IDockerConnectionSettings connectionSettings,
7070
final IRegistryAccount registryAccount)
7171
throws DockerCertificateException {
72-
final DockerClientBuilder builder = DockerClientBuilder.fromEnv()
73-
.uri((URI) null);
72+
final DockerClientBuilder builder = DockerClientBuilder.fromEnv();
7473
if (connectionSettings
7574
.getType() == BindingType.UNIX_SOCKET_CONNECTION) {
7675
final UnixSocketConnectionSettings unixSocketConnectionSettings = (UnixSocketConnectionSettings) connectionSettings;
7776
if (unixSocketConnectionSettings.hasPath()) {
78-
builder.uri(unixSocketConnectionSettings.getPath());
77+
String path = unixSocketConnectionSettings.getPath();
78+
builder.uri(path);
79+
} else {
80+
return null;
7981
}
8082

8183
} else {
8284
final TCPConnectionSettings tcpConnectionSettings = (TCPConnectionSettings) connectionSettings;
8385
if (tcpConnectionSettings.hasHost()) {
84-
builder.uri(URI.create(tcpConnectionSettings.getHost()));
86+
String host = tcpConnectionSettings.getHost();
87+
builder.uri(URI.create(host));
8588
if (tcpConnectionSettings.getPathToCertificates() != null
8689
&& !tcpConnectionSettings.getPathToCertificates()
8790
.isEmpty()) {
8891
builder.dockerCertificates(new DockerCertificates(new File(
8992
tcpConnectionSettings.getPathToCertificates())
9093
.toPath()));
9194
}
95+
} else {
96+
return null;
9297
}
9398
}
94-
// skip if no URI exists
95-
if (builder.uri() == null) {
96-
return null;
97-
}
9899

99100
if (registryAccount != null) {
100101
// mimic spotify:

containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/TCPConnectionSettings.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* Copyright (c) 2015, 2018 Red Hat.
3-
*
3+
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
66
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -44,7 +44,7 @@ public class TCPConnectionSettings extends BaseConnectionSettings {
4444

4545
/**
4646
* Constructor
47-
*
47+
*
4848
* @param host
4949
* host to connect to
5050
* @param pathToCertificates
@@ -53,7 +53,11 @@ public class TCPConnectionSettings extends BaseConnectionSettings {
5353
public TCPConnectionSettings(final String host,
5454
final String pathToCertificates) {
5555
super();
56-
this.host = new HostBuilder(host).enableTLS(pathToCertificates);
56+
if (host != null) {
57+
this.host = new HostBuilder(host).enableTLS(pathToCertificates);
58+
} else {
59+
this.host = null;
60+
}
5761
this.pathToCertificates = pathToCertificates;
5862
}
5963

releng/org.eclipse.linuxtools.target/linuxtools-latest.target

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
<dependency>
267267
<groupId>org.mandas</groupId>
268268
<artifactId>docker-client</artifactId>
269-
<version>9.0.4</version>
269+
<version>10.0.0</version>
270270
<type>jar</type>
271271
</dependency>
272272
</dependencies>

0 commit comments

Comments
 (0)