Source:
<code>public KeyMaterial materialize() throws IOException, InterruptedException { FilePath dockerConfig = createSecretsDirectory(); FilePath configJsonPath = FilePath.getHomeDirectory(this.launcher.getChannel()).child(".docker").child(DOCKER_CONFIG_FILENAME); <START> dockerConfig = UpdateDockerConfigFromSource(dockerConfig, configJsonPath, BLACKLISTED_PROPERTIES); <END> String existingDockerSecretConfigPath = this.env.get("DOCKER_CONFIG"); if (StringUtils.isNotBlank(existingDockerSecretConfigPath)) { FilePath baseDir = getContext().getBaseDir(); String existingTmpConfigDir = existingDockerSecretConfigPath.substring(baseDir.getRemote().length() + 1); FilePath existingDockerConfigPath = baseDir.child(existingTmpConfigDir).child(DOCKER_CONFIG_FILENAME); dockerConfig = UpdateDockerConfigFromSource(dockerConfig, existingDockerConfigPath, BLACKLISTED_NESTED_PROPERTIES); } try { EnvVars envWithConfig = new EnvVars(env); envWithConfig.put("DOCKER_CONFIG", dockerConfig.getRemote()); if (launcher.launch().cmds(new ArgumentListBuilder(dockerExecutable, "login", "-u", username, "-p").add(password, true).add(endpoint)).envs(envWithConfig).stdout(listener).join() != 0) { throw new AbortException("docker login failed"); } } catch (IOException | InterruptedException x) { try { dockerConfig.deleteRecursive(); } catch (Exception x2) { x.addSuppressed(x2); } throw x; } return new RegistryKeyMaterial(dockerConfig, new EnvVars("DOCKER_CONFIG", dockerConfig.getRemote())); }</code><technical_language>suggestion dockerConfig = updateDockerConfigFromSource(dockerConfig, configJsonPath, BLACKLISTED_PROPERTIES);</technical_language>

Target:
public KeyMaterial materialize() throws IOException, InterruptedException { FilePath dockerConfig = createSecretsDirectory(); FilePath configJsonPath = FilePath.getHomeDirectory(this.launcher.getChannel()).child(".docker").child(DOCKER_CONFIG_FILENAME); FilePath existingDockerConfigPath = new FilePath(this.launcher.getChannel(), Paths.get(this.env.get("DOCKER_CONFIG"), DOCKER_CONFIG_FILENAME).toString()); String dockerConfigJson = ""; if (existingDockerConfigPath.exists()) { this.launcher.getListener().getLogger().print("Reading the existing DOCKER_CONFIG '" + existingDockerConfigPath + "' docker config file.\n"); dockerConfigJson = existingDockerConfigPath.readToString(); } else if (configJsonPath.exists()) { this.launcher.getListener().getLogger().print("Reading the existing user's home '" + configJsonPath + "' docker config file.\n"); dockerConfigJson = removeBlacklistedProperties(configJsonPath.readToString(), BLACKLISTED_PROPERTIES); } if (StringUtils.isNotBlank(dockerConfigJson)) { dockerConfig.child(DOCKER_CONFIG_FILENAME).write(dockerConfigJson, StandardCharsets.UTF_8.name()); } try { EnvVars envWithConfig = new EnvVars(env); envWithConfig.put("DOCKER_CONFIG", dockerConfig.getRemote()); if (launcher.launch().cmds(new ArgumentListBuilder(dockerExecutable, "login", "-u", username, "-p").add(password, true).add(endpoint)).envs(envWithConfig).stdout(listener).join() != 0) { throw new AbortException("docker login failed"); } } catch (IOException | InterruptedException x) { try { dockerConfig.deleteRecursive(); } catch (Exception x2) { x.addSuppressed(x2); } throw x; } return new RegistryKeyMaterial(dockerConfig, new EnvVars("DOCKER_CONFIG", dockerConfig.getRemote())); }