Skip to content

Hard deprecate ProxiedUnixSocketClientProviderStrategy #2851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2020
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
4 changes: 0 additions & 4 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ dependencies {
exclude(group: "net.java.dev.jna", module: "jna")
}

compile ('org.rnorth:tcp-unix-socket-proxy:1.0.2') {
exclude(group: "log4j", module: "log4j")
}

compile "net.java.dev.jna:jna-platform:5.5.0"

shaded ('com.github.docker-java:docker-java-transport-okhttp:3.2.1') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected boolean isPersistable() {

@Override
protected int getPriority() {
return ProxiedUnixSocketClientProviderStrategy.PRIORITY - 10;
return EnvironmentAndSystemPropertyClientProviderStrategy.PRIORITY - 100;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
package org.testcontainers.dockerclient;

import lombok.extern.slf4j.Slf4j;
import org.rnorth.tcpunixsocketproxy.TcpToUnixSocketProxy;

import java.io.File;

@Slf4j
/**
* @deprecated no longer needed since `docker-java` supports all transport modes now
*/
@Deprecated
public class ProxiedUnixSocketClientProviderStrategy extends UnixSocketClientProviderStrategy {

public static final int PRIORITY = EnvironmentAndSystemPropertyClientProviderStrategy.PRIORITY - 100;

private final File socketFile = new File(DOCKER_SOCK_PATH);

@Override
protected boolean isApplicable() {
return socketFile.exists();
return false;
}

@Override
Expand All @@ -24,26 +20,12 @@ protected int getPriority() {

@Override
public void test() throws InvalidConfigurationException {
TcpToUnixSocketProxy proxy = new TcpToUnixSocketProxy(socketFile);

try {
int proxyPort = proxy.start().getPort();

config = tryConfiguration("tcp://localhost:" + proxyPort);

log.debug("Accessing unix domain socket via TCP proxy (" + DOCKER_SOCK_PATH + " via localhost:" + proxyPort + ")");
} catch (Exception e) {

proxy.stop();

throw new InvalidConfigurationException("ping failed", e);
}

throw new InvalidConfigurationException("Deprecated");
}

@Override
public String getDescription() {
return "local Unix socket (via TCP proxy)";
return "[Deprecated] local Unix socket (via TCP proxy)";
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy
org.testcontainers.dockerclient.UnixSocketClientProviderStrategy
org.testcontainers.dockerclient.ProxiedUnixSocketClientProviderStrategy
org.testcontainers.dockerclient.DockerMachineClientProviderStrategy
org.testcontainers.dockerclient.WindowsClientProviderStrategy
org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy