Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public VersionCmd versionCmd() {
@Override
public PullImageCmd pullImageCmd(String repository) {
return new PullImageCmdImpl(getDockerCmdExecFactory()
.createPullImageCmdExec(), repository).withAuthConfig(dockerClientConfig.effectiveAuthConfig(repository));
.createPullImageCmdExec(), dockerClientConfig.effectiveAuthConfig(repository), repository);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
public abstract class AbstrAuthCfgDockerCmd<T extends DockerCmd<RES_T>, RES_T> extends
AbstrDockerCmd<T, RES_T> {

public AbstrAuthCfgDockerCmd(DockerCmdExec<T, RES_T> execution, AuthConfig authConfig) {
super(execution);
withOptionalAuthConfig(authConfig);
}

public AbstrAuthCfgDockerCmd(DockerCmdExec<T, RES_T> execution) {
super(execution);
}
Expand All @@ -25,9 +30,13 @@ public AuthConfig getAuthConfig() {
return authConfig;
}

@SuppressWarnings("unchecked")
public T withAuthConfig(AuthConfig authConfig) {
Preconditions.checkNotNull(authConfig, "authConfig was not specified");
return withOptionalAuthConfig(authConfig);
}

@SuppressWarnings("unchecked")
private T withOptionalAuthConfig(AuthConfig authConfig) {
this.authConfig = authConfig;
return (T)this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.dockerjava.core.command;

import com.github.dockerjava.api.command.PullImageCmd;
import com.github.dockerjava.api.model.AuthConfig;
import com.google.common.base.Preconditions;

import java.io.InputStream;
Expand All @@ -14,8 +15,8 @@ public class PullImageCmdImpl extends AbstrAuthCfgDockerCmd<PullImageCmd, InputS

private String repository, tag, registry;

public PullImageCmdImpl(PullImageCmd.Exec exec, String repository) {
super(exec);
public PullImageCmdImpl(PullImageCmd.Exec exec, AuthConfig authConfig, String repository) {
super(exec, authConfig);
withRepository(repository);
}

Expand Down