Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.28.0",
org.eclipse.equinox.registry;bundle-version="3.11.300",
org.eclipse.equinox.security,
org.eclipse.osgi,
org.mandas.docker-client;bundle-version="7.0.7",
org.mandas.docker-client;bundle-version="10.0.0",
org.glassfish.jersey.core.jersey-client;bundle-version="3.1.5",
org.glassfish.jersey.media.jersey-media-json-jackson;bundle-version="3.1.5",
org.glassfish.jersey.core.jersey-common;bundle-version="3.1.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,32 +69,33 @@ public DockerClient getClient(
final IDockerConnectionSettings connectionSettings,
final IRegistryAccount registryAccount)
throws DockerCertificateException {
final DockerClientBuilder builder = DockerClientBuilder.fromEnv()
.uri((URI) null);
final DockerClientBuilder builder = DockerClientBuilder.fromEnv();
if (connectionSettings
.getType() == BindingType.UNIX_SOCKET_CONNECTION) {
final UnixSocketConnectionSettings unixSocketConnectionSettings = (UnixSocketConnectionSettings) connectionSettings;
if (unixSocketConnectionSettings.hasPath()) {
builder.uri(unixSocketConnectionSettings.getPath());
String path = unixSocketConnectionSettings.getPath();
builder.uri(path);
} else {
return null;
}

} else {
final TCPConnectionSettings tcpConnectionSettings = (TCPConnectionSettings) connectionSettings;
if (tcpConnectionSettings.hasHost()) {
builder.uri(URI.create(tcpConnectionSettings.getHost()));
String host = tcpConnectionSettings.getHost();
builder.uri(URI.create(host));
if (tcpConnectionSettings.getPathToCertificates() != null
&& !tcpConnectionSettings.getPathToCertificates()
.isEmpty()) {
builder.dockerCertificates(new DockerCertificates(new File(
tcpConnectionSettings.getPathToCertificates())
.toPath()));
}
} else {
return null;
}
}
// skip if no URI exists
if (builder.uri() == null) {
return null;
}

if (registryAccount != null) {
// mimic spotify:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2015, 2018 Red Hat.
*
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -44,7 +44,7 @@ public class TCPConnectionSettings extends BaseConnectionSettings {

/**
* Constructor
*
*
* @param host
* host to connect to
* @param pathToCertificates
Expand All @@ -53,7 +53,11 @@ public class TCPConnectionSettings extends BaseConnectionSettings {
public TCPConnectionSettings(final String host,
final String pathToCertificates) {
super();
this.host = new HostBuilder(host).enableTLS(pathToCertificates);
if (host != null) {
this.host = new HostBuilder(host).enableTLS(pathToCertificates);
} else {
this.host = null;
}
this.pathToCertificates = pathToCertificates;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
<dependency>
<groupId>org.mandas</groupId>
<artifactId>docker-client</artifactId>
<version>9.0.4</version>
<version>10.0.0</version>
<type>jar</type>
</dependency>
</dependencies>
Expand Down
Loading