Skip to content

Commit bd11042

Browse files
committed
Rename withServerAddress to withRegistryAddress.
This is more correct as auth used only for pull/push operations.
1 parent 43feaf1 commit bd11042

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

src/main/java/com/github/dockerjava/api/model/AuthConfig.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class AuthConfig {
2727
private String email;
2828

2929
@JsonProperty("serveraddress")
30-
private String serverAddress = DEFAULT_SERVER_ADDRESS;
30+
private String registryAddress = DEFAULT_SERVER_ADDRESS;
3131

3232
@JsonProperty("auth")
3333
private String auth;
@@ -59,12 +59,12 @@ public AuthConfig withEmail(String email) {
5959
return this;
6060
}
6161

62-
public String getServerAddress() {
63-
return serverAddress;
62+
public String getRegistryAddress() {
63+
return registryAddress;
6464
}
6565

66-
public AuthConfig withServerAddress(String serverAddress) {
67-
this.serverAddress = serverAddress;
66+
public AuthConfig withRegistryAddress(String registryAddress) {
67+
this.registryAddress = registryAddress;
6868
return this;
6969
}
7070

@@ -90,7 +90,7 @@ public int hashCode() {
9090
result = prime * result + ((auth == null) ? 0 : auth.hashCode());
9191
result = prime * result + ((email == null) ? 0 : email.hashCode());
9292
result = prime * result + ((password == null) ? 0 : password.hashCode());
93-
result = prime * result + ((serverAddress == null) ? 0 : serverAddress.hashCode());
93+
result = prime * result + ((registryAddress == null) ? 0 : registryAddress.hashCode());
9494
result = prime * result + ((username == null) ? 0 : username.hashCode());
9595
return result;
9696
}
@@ -119,10 +119,10 @@ public boolean equals(Object obj) {
119119
return false;
120120
} else if (!password.equals(other.password))
121121
return false;
122-
if (serverAddress == null) {
123-
if (other.serverAddress != null)
122+
if (registryAddress == null) {
123+
if (other.registryAddress != null)
124124
return false;
125-
} else if (!serverAddress.equals(other.serverAddress))
125+
} else if (!registryAddress.equals(other.registryAddress))
126126
return false;
127127
if (username == null) {
128128
if (other.username != null)

src/main/java/com/github/dockerjava/api/model/AuthConfigurations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class AuthConfigurations {
1111
private Map<String, AuthConfig> configs = new TreeMap<>();
1212

1313
public void addConfig(AuthConfig authConfig) {
14-
configs.put(authConfig.getServerAddress(), authConfig);
14+
configs.put(authConfig.getRegistryAddress(), authConfig);
1515
}
1616

1717
public Map<String, AuthConfig> getConfigs() {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public AuthConfigFile() {
2929
}
3030

3131
void addConfig(AuthConfig config) {
32-
authConfigMap.put(config.getServerAddress(), config);
32+
authConfigMap.put(config.getRegistryAddress(), config);
3333
}
3434

3535
public AuthConfig resolveAuthConfig(String hostname) {
@@ -112,7 +112,7 @@ public static AuthConfigFile loadConfig(File confFile) throws IOException {
112112
AuthConfig authConfig = entry.getValue();
113113
decodeAuth(authConfig.getAuth(), authConfig);
114114
authConfig.withAuth(null);
115-
authConfig.withServerAddress(entry.getKey());
115+
authConfig.withRegistryAddress(entry.getKey());
116116
configFile.addConfig(authConfig);
117117
}
118118
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ && getRegistryUrl() != null) {
282282
.withUsername(getRegistryUsername())
283283
.withPassword(getRegistryPassword())
284284
.withEmail(getRegistryEmail())
285-
.withServerAddress(getRegistryUrl());
285+
.withRegistryAddress(getRegistryUrl());
286286
}
287287
return authConfig;
288288
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public AuthConfig authConfig() {
168168
.withUsername(dockerClientConfig.getRegistryUsername())
169169
.withPassword(dockerClientConfig.getRegistryPassword())
170170
.withEmail(dockerClientConfig.getRegistryEmail())
171-
.withServerAddress(dockerClientConfig.getRegistryUrl());
171+
.withRegistryAddress(dockerClientConfig.getRegistryUrl());
172172
}
173173

174174
/**

src/test/java/com/github/dockerjava/api/model/AuthConfigTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public void setUp() throws Exception {
1414
authConfig = new AuthConfig()
1515
.withEmail("foo")
1616
.withPassword("bar")
17-
.withServerAddress("baz")
17+
.withRegistryAddress("baz")
1818
.withUsername("qux");
1919
}
2020

2121
@Test
2222
public void defaultServerAddress() throws Exception {
23-
assertEquals(new AuthConfig().getServerAddress(), "https://index.docker.io/v1/");
23+
assertEquals(new AuthConfig().getRegistryAddress(), "https://index.docker.io/v1/");
2424
}
2525
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ public void validJson() throws IOException {
5252
.withEmail("foo@example.com")
5353
.withUsername("foo")
5454
.withPassword("bar")
55-
.withServerAddress("quay.io");
55+
.withRegistryAddress("quay.io");
5656

5757
AuthConfig authConfig2 = new AuthConfig()
5858
.withEmail("moo@example.com")
5959
.withUsername("foo1")
6060
.withPassword("bar1")
61-
.withServerAddress(AuthConfig.DEFAULT_SERVER_ADDRESS);
61+
.withRegistryAddress(AuthConfig.DEFAULT_SERVER_ADDRESS);
6262

6363
AuthConfigFile expected = new AuthConfigFile();
6464
expected.addConfig(authConfig1);
@@ -74,7 +74,7 @@ public void validLegacy() throws IOException {
7474
.withEmail("foo@example.com")
7575
.withUsername("foo")
7676
.withPassword("bar")
77-
.withServerAddress(AuthConfig.DEFAULT_SERVER_ADDRESS);
77+
.withRegistryAddress(AuthConfig.DEFAULT_SERVER_ADDRESS);
7878

7979
AuthConfigFile expected = new AuthConfigFile();
8080
expected.addConfig(authConfig);

src/test/java/com/github/dockerjava/core/command/BuildImageCmdImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public void testBuildFromPrivateRegistry() throws Exception {
279279
.withUsername("testuser")
280280
.withPassword("testpassword")
281281
.withEmail("foo@bar.de")
282-
.withServerAddress("localhost:5000");
282+
.withRegistryAddress("localhost:5000");
283283

284284
dockerClient.authCmd().withAuthConfig(authConfig).exec();
285285
dockerClient.tagImageCmd("busybox:latest", "localhost:5000/testuser/busybox", "latest").withForce().exec();

src/test/java/com/github/dockerjava/netty/exec/BuildImageCmdExecTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public void testBuildFromPrivateRegistry() throws Exception {
271271
.withUsername("testuser")
272272
.withPassword("testpassword")
273273
.withEmail("foo@bar.de")
274-
.withServerAddress("localhost:5000");
274+
.withRegistryAddress("localhost:5000");
275275

276276
dockerClient.authCmd().withAuthConfig(authConfig).exec();
277277
dockerClient.tagImageCmd("busybox:latest", "localhost:5000/testuser/busybox", "latest").withForce().exec();

0 commit comments

Comments
 (0)