Source:
public RegistryConfigs authForAllRegistries(final Path configPath) throws IOException { checkNotNull(configPath); final DockerConfig config = MAPPER.readValue(configPath.toFile(), DockerConfig.class); if (config == null) { return RegistryConfigs.empty(); } final RegistryConfigs.Builder registryConfigsBuilder = RegistryConfigs.builder(); final Map<String, String> credsHelpers = config.credsHelpers(); final boolean hasCredsHelpers = credsHelpers != null && !credsHelpers.isEmpty(); final Map<String, RegistryAuth> auths = config.auths(); final boolean hasAuths = auths != null && !auths.isEmpty(); final String credsStore = config.credsStore(); final boolean hasCredsStore = credsStore != null; if (hasCredsHelpers) { for (final Map.Entry<String, String> credsHelpersEntry : credsHelpers.entrySet()) { final String registry = credsHelpersEntry.getKey(); final String aCredsStore = credsHelpersEntry.getValue(); registryConfigsBuilder.addConfig(registry, authWithCredentialHelper(aCredsStore, registry)); } } if (hasAuths) { final RegistryAuth empty = RegistryAuth.builder().build(); for (final Map.Entry<String, RegistryAuth> authEntry : auths.entrySet()) { final String registry = authEntry.getKey(); final RegistryAuth registryAuth = authEntry.getValue(); if (registryAuth == null || registryAuth.equals(empty)) { if (credsStore != null) { registryConfigsBuilder.addConfig(registry, authWithCredentialHelper(credsStore, registry)); } } else { registryConfigsBuilder.addConfig(registry, registryAuth.toBuilder().serverAddress(registry).build()); } } } if (!(hasAuths || hasCredsHelpers || hasCredsStore)) { try { return MAPPER.readValue(configPath.toFile(), RegistryConfigs.class); } catch (IOException ignored) { } } return registryConfigsBuilder.build(); }

Target:
public RegistryConfigs authForAllRegistries(final Path configPath) throws IOException { checkNotNull(configPath); final DockerConfig config = MAPPER.readValue(configPath.toFile(), DockerConfig.class); if (config == null) { return RegistryConfigs.empty(); } final RegistryConfigs.Builder registryConfigsBuilder = RegistryConfigs.builder(); final Map<String, String> credsHelpers = config.credsHelpers(); final boolean hasCredsHelpers = credsHelpers != null && !credsHelpers.isEmpty(); final Map<String, RegistryAuth> auths = config.auths(); final boolean hasAuths = auths != null && !auths.isEmpty(); final String credsStore = config.credsStore(); final boolean hasCredsStore = credsStore != null; if (hasCredsHelpers) { for (final Map.Entry<String, String> credsHelpersEntry : credsHelpers.entrySet()) { final String registry = credsHelpersEntry.getKey(); final String aCredsStore = credsHelpersEntry.getValue(); registryConfigsBuilder.addConfig(registry, authWithCredentialHelper(aCredsStore, registry)); } } if (hasAuths) { final RegistryAuth empty = RegistryAuth.builder().build(); for (final Map.Entry<String, RegistryAuth> authEntry : auths.entrySet()) { final String registry = authEntry.getKey(); final RegistryAuth registryAuth = authEntry.getValue(); if (registryAuth == null || registryAuth.equals(empty)) { if (hasCredsStore) { registryConfigsBuilder.addConfig(registry, authWithCredentialHelper(credsStore, registry)); } } else { registryConfigsBuilder.addConfig(registry, registryAuth.toBuilder().serverAddress(registry).build()); } } } if (!(hasAuths || hasCredsHelpers || hasCredsStore)) { try { return MAPPER.readValue(configPath.toFile(), RegistryConfigs.class); } catch (IOException ignored) { } } return registryConfigsBuilder.build(); }