@Override public PushImageCmd pushImageCmd(Identifier identifier) { PushImageCmd cmd = pushImageCmd(identifier.repository.name); if (identifier.tag.isPresent()) { cmd.withTag(identifier.tag.get()); } AuthConfig cfg = dockerClientConfig.effectiveAuthConfig(identifier.repository.name); if (cfg != null) { cmd.withAuthConfig(cfg); } return cmd; }
/** * * IMAGE API * */ @Override public PullImageCmd pullImageCmd(String repository) { return new PullImageCmdImpl(getDockerCmdExecFactory().createPullImageCmdExec(), dockerClientConfig.effectiveAuthConfig(repository), repository); }
@Override public PushImageCmd pushImageCmd(String name) { PushImageCmd cmd = new PushImageCmdImpl(getDockerCmdExecFactory().createPushImageCmdExec(), dockerClientConfig.effectiveAuthConfig(name), name); return cmd; }
@Override public CreateContainerCmd createContainerCmd(String image) { return new CreateContainerCmdImpl(getDockerCmdExecFactory() .createCreateContainerCmdExec(), dockerClientConfig.effectiveAuthConfig(image), image); }
public AuthConfig effectiveAuthConfig(String imageName) { // allow docker-java auth config to be used as a fallback AuthConfig fallbackAuthConfig; try { fallbackAuthConfig = delegate.effectiveAuthConfig(imageName); } catch (Exception e) { log.debug("Delegate call to effectiveAuthConfig failed with cause: '{}'. " + "Resolution of auth config will continue using RegistryAuthLocator.", e.getMessage()); fallbackAuthConfig = new AuthConfig(); } // try and obtain more accurate auth config using our resolution final DockerImageName parsed = new DockerImageName(imageName); final AuthConfig effectiveAuthConfig = RegistryAuthLocator.instance() .lookupAuthConfig(parsed, fallbackAuthConfig); log.debug("Effective auth config [{}]", toSafeString(effectiveAuthConfig)); return effectiveAuthConfig; }
@java.lang.SuppressWarnings("all") public com.github.dockerjava.api.model.AuthConfig effectiveAuthConfig(final java.lang.String arg0) { return this.dockerClientConfig.effectiveAuthConfig(arg0); }
@Override public PushImageCmd pushImageCmd(Identifier identifier) { PushImageCmd cmd = pushImageCmd(identifier.repository.name); if (identifier.tag.isPresent()) { cmd.withTag(identifier.tag.get()); } AuthConfig cfg = dockerClientConfig.effectiveAuthConfig(identifier.repository.name); if (cfg != null) { cmd.withAuthConfig(cfg); } return cmd; }
/** * * IMAGE API * */ @Override public PullImageCmd pullImageCmd(String repository) { return new PullImageCmdImpl(getDockerCmdExecFactory().createPullImageCmdExec(), dockerClientConfig.effectiveAuthConfig(repository), repository); }
@Override public PushImageCmd pushImageCmd(String name) { PushImageCmd cmd = new PushImageCmdImpl(getDockerCmdExecFactory().createPushImageCmdExec(), dockerClientConfig.effectiveAuthConfig(name), name); return cmd; }
public AuthConfig effectiveAuthConfig(String imageName) { // allow docker-java auth config to be used as a fallback AuthConfig fallbackAuthConfig; try { fallbackAuthConfig = delegate.effectiveAuthConfig(imageName); } catch (Exception e) { log.debug("Delegate call to effectiveAuthConfig failed with cause: \'{}\'. Resolution of auth config will continue using RegistryAuthLocator.", e.getMessage()); fallbackAuthConfig = new AuthConfig(); } // try and obtain more accurate auth config using our resolution final DockerImageName parsed = new DockerImageName(imageName); final AuthConfig effectiveAuthConfig = RegistryAuthLocator.instance().lookupAuthConfig(parsed, fallbackAuthConfig); log.debug("Effective auth config [{}]", toSafeString(effectiveAuthConfig)); return effectiveAuthConfig; }
@Override public CreateContainerCmd createContainerCmd(String image) { return new CreateContainerCmdImpl(getDockerCmdExecFactory() .createCreateContainerCmdExec(), dockerClientConfig.effectiveAuthConfig(image), image); }