File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
main/java/com/kpelykh/docker/client
test/java/com/kpelykh/docker/client/test Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ public void push(final String name) throws DockerException {
242
242
}
243
243
try {
244
244
final String registryAuth = registryAuth ();
245
- client .resource (restEndpointUrl + "/images/" + name + "/push" )
245
+ client .resource (restEndpointUrl + "/images/" + name ( name ) + "/push" )
246
246
.header ("X-Registry-Auth" , registryAuth )
247
247
.accept (MediaType .APPLICATION_JSON )
248
248
.post ();
@@ -251,6 +251,10 @@ public void push(final String name) throws DockerException {
251
251
}
252
252
}
253
253
254
+ private String name (String name ) {
255
+ return name .contains ("/" ) ? name : authConfig .getUsername ();
256
+ }
257
+
254
258
/**
255
259
* Create an image by importing the given stream of a tar file.
256
260
*
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public void beforeTest() throws Exception {
23
23
@ Test
24
24
public void testPushLatest () throws Exception {
25
25
setUpCredentials ();
26
- docker .push ("alexec/ busybox" );
26
+ docker .push ("busybox" );
27
27
assertThat (asString (docker .pull ("alexec/busybox" )), not (containsString ("404" )));
28
28
}
29
29
You can’t perform that action at this time.
0 commit comments