@Nonnull public static DockerConfigFile loadConfig(@CheckForNull String dockerConfigPath) throws IOException { // no any configs, but for empty auths return non null object if (dockerConfigPath == null) { return new DockerConfigFile(); } //parse new docker config file format DockerConfigFile dockerConfig = loadCurrentConfig(dockerConfigPath); //parse old auth config file format if (dockerConfig == null) { dockerConfig = loadLegacyConfig(dockerConfigPath); } //otherwise create default config if (dockerConfig == null) { dockerConfig = new DockerConfigFile(); } for (Map.Entry<String, AuthConfig> entry : dockerConfig.getAuths().entrySet()) { AuthConfig authConfig = entry.getValue(); decodeAuth(authConfig); authConfig.withAuth(null); authConfig.withRegistryAddress(entry.getKey()); } return dockerConfig; }
@Nonnull public static DockerConfigFile loadConfig(@CheckForNull String dockerConfigPath) throws IOException { // no any configs, but for empty auths return non null object if (dockerConfigPath == null) { return new DockerConfigFile(); } //parse new docker config file format DockerConfigFile dockerConfig = loadCurrentConfig(dockerConfigPath); //parse old auth config file format if (dockerConfig == null) { dockerConfig = loadLegacyConfig(dockerConfigPath); } //otherwise create default config if (dockerConfig == null) { dockerConfig = new DockerConfigFile(); } for (Map.Entry<String, AuthConfig> entry : dockerConfig.getAuths().entrySet()) { AuthConfig authConfig = entry.getValue(); decodeAuth(authConfig); authConfig.withAuth(null); authConfig.withRegistryAddress(entry.getKey()); } return dockerConfig; }