File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
main/java/com/github/dockerjava/core
test/java/com/github/dockerjava Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -252,8 +252,7 @@ public DockerConfigFile getDockerConfig() {
252252
253253 private AuthConfig getAuthConfig () {
254254 AuthConfig authConfig = null ;
255- if (getRegistryUsername () != null && getRegistryPassword () != null && getRegistryEmail () != null
256- && getRegistryUrl () != null ) {
255+ if (getRegistryUsername () != null && getRegistryPassword () != null && getRegistryUrl () != null ) {
257256 authConfig = new AuthConfig ()
258257 .withUsername (getRegistryUsername ())
259258 .withPassword (getRegistryPassword ())
Original file line number Diff line number Diff line change @@ -111,6 +111,20 @@ public void testPullImageWithValidAuth() throws Exception {
111111 .awaitCompletion (30 , TimeUnit .SECONDS );
112112 }
113113
114+ @ Test
115+ public void testPullImageWithValidAuthAndEmail () throws Exception {
116+ AuthConfig authConfig = RegistryUtils .runPrivateRegistry (dockerRule .getClient ())
117+ .withEmail ("foo@bar.de" );
118+
119+ String imgName = RegistryUtils .createPrivateImage (dockerRule , "pull-image-with-valid-auth" );
120+
121+ // stream needs to be fully read in order to close the underlying connection
122+ dockerRule .getClient ().pullImageCmd (imgName )
123+ .withAuthConfig (authConfig )
124+ .exec (new PullImageResultCallback ())
125+ .awaitCompletion (30 , TimeUnit .SECONDS );
126+ }
127+
114128 @ Test
115129 public void testPullImageWithNoAuth () throws Exception {
116130 RegistryUtils .runPrivateRegistry (dockerRule .getClient ());
@@ -130,6 +144,7 @@ public void testPullImageWithNoAuth() throws Exception {
130144 .awaitCompletion (30 , TimeUnit .SECONDS );
131145 }
132146
147+
133148 @ Test
134149 public void testPullImageWithInvalidAuth () throws Exception {
135150 AuthConfig validAuthConfig = RegistryUtils .runPrivateRegistry (dockerRule .getClient ());
Original file line number Diff line number Diff line change @@ -81,7 +81,6 @@ public static synchronized AuthConfig runPrivateRegistry(DockerClient dockerClie
8181 privateRegistryAuthConfig = new AuthConfig ()
8282 .withUsername ("testuser" )
8383 .withPassword ("testpassword" )
84- .withEmail ("foo@bar.de" )
8584 .withRegistryAddress ("localhost:" + port );
8685 }
8786
You can’t perform that action at this time.
0 commit comments