X Tutup
Skip to content

Commit fc6b71f

Browse files
author
michael.freund
committed
swarm fixes
1 parent 3be2793 commit fc6b71f

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/main/java/com/github/dockerjava/core/DockerClientConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ public class DockerClientConfig implements Serializable {
5151

5252
public static final String REGISTRY_URL = "registry.url";
5353

54+
public static final String DOCKER_IS_SWARM_ENDPOINT = "isSwarmEndpoint";
55+
5456
private static final String DOCKER_JAVA_PROPERTIES = "docker-java.properties";
5557

5658
private static final String DOCKER_CFG = ".dockercfg";
5759

5860
private static final Set<String> CONFIG_KEYS = new HashSet<String>();
5961

60-
private static final String DOCKER_IS_SWARM_ENDPOINT = "isSwarmEndpoint";
61-
6262
static {
6363
CONFIG_KEYS.add(DOCKER_HOST);
6464
CONFIG_KEYS.add(DOCKER_TLS_VERIFY);

src/test/java/com/github/dockerjava/core/DockerClientConfigTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void environment() throws Exception {
7878
env.put(DockerClientConfig.DOCKER_CONFIG, "dockerConfig");
7979
env.put(DockerClientConfig.DOCKER_CERT_PATH, dockerCertPath());
8080
env.put(DockerClientConfig.DOCKER_TLS_VERIFY, "1");
81-
env.put(DockerClientConfig.DOCKER_SWARM, "false");
81+
env.put(DockerClientConfig.DOCKER_IS_SWARM_ENDPOINT, "false");
8282

8383

8484
// when you build a config
@@ -127,6 +127,7 @@ public void systemProperties() throws Exception {
127127
systemProperties.put(DockerClientConfig.DOCKER_CONFIG, "dockerConfig");
128128
systemProperties.put(DockerClientConfig.DOCKER_CERT_PATH, dockerCertPath());
129129
systemProperties.put(DockerClientConfig.DOCKER_TLS_VERIFY, "1");
130+
systemProperties.put(DockerClientConfig.DOCKER_IS_SWARM_ENDPOINT, "false");
130131

131132
// when you build new config
132133
DockerClientConfig config = buildConfig(Collections.<String, String> emptyMap(), systemProperties);
@@ -147,36 +148,36 @@ public void serializableTest() {
147148
@Test(expectedExceptions = DockerClientException.class)
148149
public void testTlsVerifyAndCertPathNull() throws Exception {
149150
new DockerClientConfig(URI.create("tcp://foo"), "dockerConfig", "apiVersion", "registryUrl", "registryUsername", "registryPassword", "registryEmail",
150-
null, true);
151+
null, true, false);
151152
}
152153

153154
@Test(expectedExceptions = DockerClientException.class)
154155
public void testTlsVerifyAndCertPathEmpty() throws Exception {
155156
new DockerClientConfig(URI.create("tcp://foo"), "dockerConfig", "apiVersion", "registryUrl", "registryUsername", "registryPassword", "registryEmail",
156-
"", true);
157+
"", true, false);
157158
}
158159

159160
@Test()
160161
public void testTlsVerifyAndCertPath() throws Exception {
161162
new DockerClientConfig(URI.create("tcp://foo"), "dockerConfig", "apiVersion", "registryUrl", "registryUsername", "registryPassword", "registryEmail",
162-
dockerCertPath(), true);
163+
dockerCertPath(), true, false);
163164
}
164165

165166
@Test(expectedExceptions = DockerClientException.class)
166167
public void testWrongHostScheme() throws Exception {
167168
new DockerClientConfig(URI.create("http://foo"), "dockerConfig", "apiVersion", "registryUrl", "registryUsername", "registryPassword", "registryEmail",
168-
null, false);
169+
null, false, false);
169170
}
170171

171172
@Test()
172173
public void testTcpHostScheme() throws Exception {
173174
new DockerClientConfig(URI.create("tcp://foo"), "dockerConfig", "apiVersion", "registryUrl", "registryUsername", "registryPassword", "registryEmail",
174-
null, false);
175+
null, false, false);
175176
}
176177

177178
@Test()
178179
public void testUnixHostScheme() throws Exception {
179180
new DockerClientConfig(URI.create("unix://foo"), "dockerConfig", "apiVersion", "registryUrl", "registryUsername", "registryPassword", "registryEmail",
180-
null, false);
181+
null, false, false);
181182
}
182183
}

src/test/java/com/github/dockerjava/core/DockerClientImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class DockerClientImplTest {
1212
@Test
1313
public void configuredInstanceAuthConfig() throws Exception {
1414
// given a config with null serverAddress
15-
DockerClientConfig dockerClientConfig = new DockerClientConfig(URI.create("tcp://foo"), null, null, null, "", "", "", null, false);
15+
DockerClientConfig dockerClientConfig = new DockerClientConfig(URI.create("tcp://foo"), null, null, null, "", "", "", null, false, false);
1616
DockerClientImpl dockerClient = DockerClientImpl.getInstance(dockerClientConfig);
1717

1818
// when we get the auth config

0 commit comments

Comments
 (0)
X Tutup