Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Commit

Permalink
ensure build() works as expected when dockerAuth is true
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnworb committed May 23, 2017
1 parent e228b4f commit d5cffbc
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2630,7 +2630,9 @@ public boolean dockerAuth() {
*
* @param dockerAuth tells if Docker auth info should be used
* @return Builder
* @deprecated in favor of {@link #registryAuthSupplier(RegistryAuthSupplier)}
*/
@Deprecated
public Builder dockerAuth(final boolean dockerAuth) {
this.dockerAuth = dockerAuth;
return this;
Expand All @@ -2646,7 +2648,7 @@ public RegistryAuth registryAuth() {
* @param registryAuth RegistryAuth object
* @return Builder
*
* @deprecated in favor of registryAuthSupplier
* @deprecated in favor of {@link #registryAuthSupplier(RegistryAuthSupplier)}
*/
@Deprecated
public Builder registryAuth(final RegistryAuth registryAuth) {
Expand Down Expand Up @@ -2676,9 +2678,9 @@ public Builder registryAuthSupplier(final RegistryAuthSupplier registryAuthSuppl
}

public DefaultDockerClient build() {
if (dockerAuth) {
if (dockerAuth && registryAuthSupplier == null && registryAuth == null) {
try {
this.registryAuth = RegistryAuth.fromDockerConfig().build();
registryAuth(RegistryAuth.fromDockerConfig().build());
} catch (IOException e) {
log.warn("Unable to use Docker auth info", e);
}
Expand Down

0 comments on commit d5cffbc

Please sign in to comment.