@Test public void testName() { final String s = "some.host.com:3233/namespace/image:tag"; final AuthConfigurations authConfigurations = new AuthConfigurations(); authConfigurations.addConfig( new AuthConfig() .withRegistryAddress("some.host.com:3233") .withUsername("user") .withPassword("pass") ); final AuthConfig authConfig = getAuthConfig(s, authConfigurations); assertThat(authConfig, notNullValue()); }
@CheckForNull public static AuthConfig getAuthConfig(String forImage, AuthConfigurations authConfigurations) { NameParser.ReposTag reposTag = NameParser.parseRepositoryTag(forImage); final NameParser.HostnameReposName hostnameReposName = resolveRepositoryName(reposTag.repos); return authConfigurations.getConfigs().getOrDefault(hostnameReposName.hostname, null); }
DockerJavaUtils { @CheckForNull public static AuthConfig getAuthConfig(String forImage, AuthConfigurations authConfigurations) { NameParser.ReposTag reposTag = NameParser.parseRepositoryTag(forImage); final NameParser.HostnameReposName hostnameReposName = resolveRepositoryName(reposTag.repos); return authConfigurations.getConfigs().getOrDefault(hostnameReposName.hostname, null); } }
DockerJavaUtils { @CheckForNull public static AuthConfig getAuthConfig(String forImage, AuthConfigurations authConfigurations) { NameParser.ReposTag reposTag = NameParser.parseRepositoryTag(forImage); final NameParser.HostnameReposName hostnameReposName = resolveRepositoryName(reposTag.repos); return authConfigurations.getConfigs().getOrDefault(hostnameReposName.hostname, null); } private  DockerJavaUtils(); }
DockerJavaUtils { @CheckForNull public static AuthConfig getAuthConfig(String forImage, AuthConfigurations authConfigurations) { NameParser.ReposTag reposTag = NameParser.parseRepositoryTag(forImage); final NameParser.HostnameReposName hostnameReposName = resolveRepositoryName(reposTag.repos); return authConfigurations.getConfigs().getOrDefault(hostnameReposName.hostname, null); } private  DockerJavaUtils(); @CheckForNull static AuthConfig getAuthConfig(String forImage, AuthConfigurations authConfigurations); }
DockerJavaUtils { @CheckForNull public static AuthConfig getAuthConfig(String forImage, AuthConfigurations authConfigurations) { NameParser.ReposTag reposTag = NameParser.parseRepositoryTag(forImage); final NameParser.HostnameReposName hostnameReposName = resolveRepositoryName(reposTag.repos); return authConfigurations.getConfigs().getOrDefault(hostnameReposName.hostname, null); } private  DockerJavaUtils(); @CheckForNull static AuthConfig getAuthConfig(String forImage, AuthConfigurations authConfigurations);  }