| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9bdabc1 commit 14ead2c
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -252,8 +252,7 @@ public DockerConfigFile getDockerConfig() { | |||
| 252 | 252 | ||
| 253 | 253 | private AuthConfig getAuthConfig() { | |
| 254 | 254 | AuthConfig authConfig = null; | |
| 255 | - if (getRegistryUsername() != null && getRegistryPassword() != null && getRegistryEmail() != null | ||
| 256 | - && getRegistryUrl() != null) { | ||
| 255 | + if (getRegistryUsername() != null && getRegistryPassword() != null && getRegistryUrl() != null) { | ||
| 257 | 256 | authConfig = new AuthConfig() | |
| 258 | 257 | .withUsername(getRegistryUsername()) | |
| 259 | 258 | .withPassword(getRegistryPassword()) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -111,6 +111,20 @@ public void testPullImageWithValidAuth() throws Exception { | |||
| 111 | 111 | .awaitCompletion(30, TimeUnit.SECONDS); | |
| 112 | 112 | } | |
| 113 | 113 | ||
| 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 | + | ||
| 114 | 128 | @Test | |
| 115 | 129 | public void testPullImageWithNoAuth() throws Exception { | |
| 116 | 130 | RegistryUtils.runPrivateRegistry(dockerRule.getClient()); | |
@@ -130,6 +144,7 @@ public void testPullImageWithNoAuth() throws Exception { | |||
| 130 | 144 | .awaitCompletion(30, TimeUnit.SECONDS); | |
| 131 | 145 | } | |
| 132 | 146 | ||
| 147 | + | ||
| 133 | 148 | @Test | |
| 134 | 149 | public void testPullImageWithInvalidAuth() throws Exception { | |
| 135 | 150 | 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 | |||
| 81 | 81 | privateRegistryAuthConfig = new AuthConfig() | |
| 82 | 82 | .withUsername("testuser") | |
| 83 | 83 | .withPassword("testpassword") | |
| 84 | - .withEmail("foo@bar.de") | ||
| 85 | 84 | .withRegistryAddress("localhost:" + port); | |
| 86 | 85 | } | |
| 87 | 86 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments